You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seeing as we're requiring a bunch of modules already and just calling functions in server.js, it might be better to also do the same with the sessions function.
functionsessions(req,res,next){constsid=req.signedCookies.sid;//undefined if there is not a sidconstsession=getSession(sid);//undefined if there is no sessionif(session){constexpiry=newDate(session.expires_at);consttoday=newDate();if(expiry<today){removeSession(sid);res.clearCookie('sid');}else{req.session=session;}}next();}
The text was updated successfully, but these errors were encountered:
Seeing as we're requiring a bunch of modules already and just calling functions in server.js, it might be better to also do the same with the sessions function.
The text was updated successfully, but these errors were encountered: