samples/sample3/handlers/sessions.js
function sendSessionResponse(req, res, next) {
  // Set the session cookie
  res.cookie('session', req.session.id);

  // Set the Location HTTP header
  res.location('/sessions/' + req.session.id);

  // Send the response
  res.status(201).json(req.session);
}
function sendSessionResponse(req, res, next) {
  // Set the session cookie
  res.cookie('session', req.session.id);

  // Set the Location HTTP header
  res.location('/sessions/' + req.session.id);

  // Send the response
  res.status(201).json(req.session);
}
function sendSessionResponse ( req , res , next ) { // Set the session cookie res . cookie ( 'session' , req . session . id ) ; // Set the Location HTTP header res . location ( '/sessions/' + req . session . id ) ; // Send the response res . status ( 201 ) . json ( req . session ) ; }
Sends the session data and session cookie.
Sends the session data and session cookie .