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 notified when a session expires by its life time #53

Closed
blueturtle13g opened this issue Oct 24, 2018 · 2 comments
Closed

get notified when a session expires by its life time #53

blueturtle13g opened this issue Oct 24, 2018 · 2 comments

Comments

@blueturtle13g
Copy link

blueturtle13g commented Oct 24, 2018

how can I get notified when a session expires by its lifetime?
I need it because I want to set the user state as offline. when he or she logs out or it's session lifetime expires.
thanks.

@alexedwards
Copy link
Owner

alexedwards commented Oct 25, 2018 via email

@alexedwards
Copy link
Owner

With v2.0.0 this should now be possible. The Commit() method returns the session token and expiry time after saving the session data to the store. You can use middleware to automate saving the session data and do whatever else you need to do with the expiry time, similar to this gist: https://gist.github.com/alexedwards/cc6190195acfa466bf27f05aa5023f50

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