Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How can I find the session Id when using express / connect and a session store?
- .destroy(sid, callback)
- app.post('/login', function(req, res)
- {
- var sid = req.sessionID;
- var username = req.body.user;
- var password = req.body.pass;
- users.findOne({username : username, password : password}, function(err, result)
- {
- ...
- sessionStore.destroy(result.session, function(){
- ...
- users.update({_id: result._id}, {$set:{"session" : sid}});
- ...
- }
- ...
- }
- }
Add Comment
Please, Sign In to add comment