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

get data out of sessionStore #29

Closed
nofear87 opened this issue Nov 20, 2013 · 5 comments
Closed

get data out of sessionStore #29

nofear87 opened this issue Nov 20, 2013 · 5 comments
Labels

Comments

@nofear87
Copy link

i create a session variable named session.active. when ever a user with a valid session comes i will set session.active = 1 and when he disconnects i will set session.active = 0.

at the admin site i will get all users (sessions) with the session.active = 1

i try to stringify and parse the json (storeSession) but i dont reach the active variable.

can you help me please?

@wcamarao
Copy link
Owner

if you stringify storeSession it will loose its reference so it makes sense that you're loosing session state. try not to parse/stringify storeSession, using .save() like in the example.

BTW, if you run the example, does it work on your local?

@nofear87
Copy link
Author

thank you for fast answering and sorry for my bad english

i have two diffrent problems i think.

how can i read all stored session.usernames or session.active variable out of the session store (admin should see all active users)? that is the first problem.

the second problem is that on socket disconnect the sessionStore isnt updated i dont using stringify or somethink else there.

@wcamarao
Copy link
Owner

I'm not sure how to help you other than asking you to first thing make sure you can run the example in your local. Can you give it a try and let us know how that goes?

@nofear87
Copy link
Author

Yes local it works :-)
I dont know how to browse the sessionStore?

I need something like this:

Foreach (sessionStore as Key){
html += key.username}

bla.html(html)

So i get all usernames from all sessions.

But i dont have an idea to solve this.

@wcamarao
Copy link
Owner

The sessionStore is not part of this repository. It's an external dependency from either connect or connect-redis.

So, if you're using:

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

No branches or pull requests

2 participants