Created
March 31, 2014 17:53
-
-
Save sithu/9898125 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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