index.js
function tryGetSession (req) {
  var cookies = req.sessionCookies
  var name = req.sessionKey
  var opts = req.sessionOptions

  var str = cookies.get(name, opts)

  if (!str) {
    return undefined
  }

  debug('parse %s', str)

  try {
    return Session.deserialize(req, str)
  } catch (err) {
    return undefined
  }
}
function tryGetSession (req) {
  var cookies = req.sessionCookies
  var name = req.sessionKey
  var opts = req.sessionOptions

  var str = cookies.get(name, opts)

  if (!str) {
    return undefined
  }

  debug('parse %s', str)

  try {
    return Session.deserialize(req, str)
  } catch (err) {
    return undefined
  }
}
function tryGetSession ( req ) { var cookies = req . sessionCookies var name = req . sessionKey var opts = req . sessionOptions var str = cookies . get ( name , opts ) if ( ! str ) { return undefined } debug ( 'parse %s' , str ) try { return Session . deserialize ( req , str ) } catch ( err ) { return undefined } }
Try getting a session from a request.
@private
Try getting a session from a request .