Skip to content

Instantly share code, notes, and snippets.

@sithu
Created March 31, 2014 17:53
Show Gist options
  • Save sithu/9898125 to your computer and use it in GitHub Desktop.
Save sithu/9898125 to your computer and use it in GitHub Desktop.
// Check student implement these logics!
// index.js
// (1 pt)
function post(request, response) {
// read 'name and email from the request.body'
// get new session id
// set new session id as the 'session_id' cookie in the response
// replace "Logged In" response with response.end(login.hello(newSessionId));
};
// (0.5 pt)
function del(request, response) {
// remove session id via login.logout(xxx)
// No need to set session id in the response cookies since you just logged out!
};
// (0.5 pt)
function put(request, response) {
// refresh/regenerate session id; similar to the post() function
// set new session id as the 'session_id' cookie in the response
};
// login.js (1 pt)
Login.prototype.logout = function(sessionId) {
// Remove the given sessionId from the sessionMap
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment