Skip to content

Instantly share code, notes, and snippets.

@stagas
Created December 16, 2010 19:21
Show Gist options
  • Select an option

  • Save stagas/743840 to your computer and use it in GitHub Desktop.

Select an option

Save stagas/743840 to your computer and use it in GitHub Desktop.
if (secured || !store.cookie.secure) {
// Send an updated cookie to the browser
store.cookie.expires = typeof store.cookie.persistent === 'undefined' || store.cookie.persistent ? new Date(Date.now() + store.maxAge) : null;
// Multiple Set-Cookie headers
headers = headers || {};
var cookie = utils.serializeCookie(key, req.sessionID, store.cookie);
if (headers['Set-Cookie']) {
headers['Set-Cookie'] += '\r\nSet-Cookie: ' + cookie;
} else {
headers['Set-Cookie'] = cookie;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment