index.js
function shouldSave(req) {
      // cannot set cookie without a session ID
      if (typeof req.sessionID !== 'string') {
        debug('session ignored because of bogus req.sessionID %o', req.sessionID);
        return false;
      }

      return !saveUninitializedSession && cookieId !== req.sessionID
        ? isModified(req.session)
        : !isSaved(req.session)
    }
function shouldSave(req) {
      // cannot set cookie without a session ID
      if (typeof req.sessionID !== 'string') {
        debug('session ignored because of bogus req.sessionID %o', req.sessionID);
        return false;
      }

      return !saveUninitializedSession && cookieId !== req.sessionID
        ? isModified(req.session)
        : !isSaved(req.session)
    }
function shouldSave ( req ) { // cannot set cookie without a session ID if ( typeof req . sessionID !== 'string' ) { debug ( 'session ignored because of bogus req.sessionID %o' , req . sessionID ) ; return false ; } return ! saveUninitializedSession && cookieId !== req . sessionID ? isModified ( req . session ) : ! isSaved ( req . session ) }
determine if session should be saved to store
determine if session should be saved to store