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

Need some help with sessions please... #694

Open
javiercerdas opened this issue Jul 16, 2015 · 2 comments
Open

Need some help with sessions please... #694

javiercerdas opened this issue Jul 16, 2015 · 2 comments

Comments

@javiercerdas
Copy link

Hello everyone,
I'm running into an issue which I'm not clear why it's happening. I have 2 controllers: clients and programs.
In clients I have:
this.session.set('clientId', '1234');

in programs:
var clientId = this.session.get('clientId');

I have 2 routes defined so I can select a client from a list, and upon selection, navigate to a page with a list of programs for the selected client.

clientId is null when I get to the programs controller. I'm using node-inspector to view 'this.session' and I see the clientId getting set while in the clients controller. Like I said, in programs, it's null. If I click a link to go back to the clients listing, I can see in node-inspector, clienId appear again. It's like one session object per controller...

development.js is set to:
sessions: {
store: 'cookie'
, key: 'sid'
, expiry: 3600
}

and secrets.json has been created also.

Interesting thing though, if I set sessions to be 'memory' everything works and clientId has the value appear on both controllers.

Could anyone clarify this for me? Thanks!

@mde
Copy link
Contributor

mde commented Jul 16, 2015

Can you verify that the sid cookie is actually getting set in the browser and passed along between server/client in every request?

@javiercerdas
Copy link
Author

What would be the best way to verify this? Using Chrome, I can see the cookie getting set on first load, then when I go to the clients list, I see the cookie's sdata getting more 'stuff'... since it's encrypted, I cannot see the actual contents... is that what you mean? Thank you so much for your help, btw.

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

No branches or pull requests

2 participants