index.js
function shouldSetCookie(req) {
      // cannot set cookie without a session ID
      if (typeof req.sessionID !== 'string') {
        return false;
      }

      return cookieId !== req.sessionID
        ? saveUninitializedSession || isModified(req.session)
        : rollingSessions || req.session.cookie.expires != null && isModified(req.session);
    }
function shouldSetCookie(req) {
      // cannot set cookie without a session ID
      if (typeof req.sessionID !== 'string') {
        return false;
      }

      return cookieId !== req.sessionID
        ? saveUninitializedSession || isModified(req.session)
        : rollingSessions || req.session.cookie.expires != null && isModified(req.session);
    }
function shouldSetCookie ( req ) { // cannot set cookie without a session ID if ( typeof req . sessionID !== 'string' ) { return false ; } return cookieId !== req . sessionID ? saveUninitializedSession || isModified ( req . session ) : rollingSessions || req . session . cookie . expires != null && isModified ( req . session ) ; }
determine if cookie should be set on response
determine if cookie should be set on response