(sessionID?: string | boolean | undefined, session?: Session)
| 339 | const isSaved = (sess: Session) => originalId === sess.id && savedHash === hash(session) |
| 340 | |
| 341 | function shouldsetCookie(sessionID?: string | boolean | undefined, session?: Session) { |
| 342 | // cannot set cookie without a session ID |
| 343 | if (typeof sessionID !== 'string' || !session) return false |
| 344 | |
| 345 | return cookieId !== sessionID |
| 346 | ? saveUninitialized || isModified(session) |
| 347 | : rolling || (session.cookie.expires != null && isModified(session)) |
| 348 | } |
| 349 | |
| 350 | // determine if session should be saved to store |
| 351 | function shouldSave(id?: string, session?: Session) { |
no test coverage detected