Godfather Godfather - 2 years ago 209
Node.js Question

How to authenticate user when cookies are disabled?

I am using passportjs for user authentication, it includes both local authentication and oauth authentication, the app is working fine when cookies are enabled, but when user disable the cookies it doesn't authenticate the user, i am using session based authentication.

Answer Source

Session-based authentication like express-session requires cookies. Express-session uses cookies to store the session.id. Unless you have another way to store the session.id on the client-side and pass that information back to your session handler, you won't be able to use passport's session-based authentication.

You can also look at this question here, which goes into more depth.

How to do stateless (session-less) & cookie-less authentication?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download