I tend to use token-based auth, but you can also use cookies to keep your 
users' sessions..

The principle is the same: hook a "middleware" function into the app, into 
the request, that checks if the user is logged in.
If yes, usually it will add a 'user' object with more info to the request.

Now, usually you don't do it on your own, something like passport.js is 
what people would use for this purpose.


On Thursday, February 12, 2015 at 1:43:13 PM UTC+1, prem Kumar wrote:
>
> Hi,
>
> Need to check whether the user has logged-in or not with session before 
> every page request.. Please guide me to solve this issue..
>
>
>
>
> Thanks,
> Premkumar M.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/ae865558-a325-42d8-bcaa-cad8e669c2fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to