Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sessions broken #453

Closed
wyqydsyq opened this issue Jun 12, 2013 · 2 comments
Closed

Sessions broken #453

wyqydsyq opened this issue Jun 12, 2013 · 2 comments

Comments

@wyqydsyq
Copy link

Following the guide at: https://github.com/balderdashy/sails/wiki/Guide:-Login-Example

It seems that session data is not persisting between requests, I've tried storing in memory and disk, but either way data I store in the session does not persist.

I have console.log(req.session) in my authenticated policy, as well as console.log(req.session) in my login controller after setting the session variables (req.session.authenticated = true; and req.session.user = user;).

The first log shows no auth variable or user data as expected, the call after authenticating does, as expected, but when I load a page it's expected that the first log will now contain the data that was set, it doesn't, the session data is reset completely.

@dcbartlett
Copy link
Contributor

Was this actually broken?

@wyqydsyq
Copy link
Author

Nope, user error, I misunderstood the store property of the session configuration object - I thought it was to specify which adapter to use for session storage, removing it from my config made sessions work.

What is actually meant to be used for the store property? The docs say nothing other than it needs to be an object, nothing on what that object should contain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants