1

I am making a web app with AgularJS as my front-end and Sails(NodeJS + Express) as my backend. I am using passport (passport-local) for authentication and it all seemed to work great until I tested it in safari. I noticed that the sessions would always return null.

I was using passport session for authorization and I couldn't fetch the session variable using req.session.passport since it was empty. I figured out that I had cookies disabled in Safari. This would break my app's authorization. Is there a way to have session management which would work even if cookies are disabled in a browser?

Travis Webb
  • 14,688
  • 7
  • 55
  • 109
Sambhav Sharma
  • 5,741
  • 9
  • 53
  • 95

1 Answers1

2

An alternative to cookies is tokens.

One popular implementation of tokens is JSON Web Tokens (JWT). There is a module for using them with Express called express-jwt and a blog post showing how to use it. For integration with Passport, you may use this SO answer as a guide.

Community
  • 1
  • 1
mscdex
  • 104,356
  • 15
  • 192
  • 153