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

Session creation hook #215

Closed
james-s-turner opened this issue Feb 16, 2016 · 2 comments
Closed

Session creation hook #215

james-s-turner opened this issue Feb 16, 2016 · 2 comments

Comments

@james-s-turner
Copy link

Hi,
I'd like to be able to log whenever a session is created. I initially thought I could simply provide a function for transformId that writes to my log file and returns the sessionId unchanged. However it is called multiple times with the same sessionId. Is it possible to find out when a new session is created.

Thanks

@jdesboeufs
Copy link
Owner

Hi,
The MongoStore emits some events: at least set, touch, destroy. It's more appropriate than your workaround ;)
But it could be useful to know when a session ID is persisted for the first time.
The rawResponse returned by the upsert may help in this case. We must investigate.

@jdesboeufs
Copy link
Owner

@james-s-turner Session creation hook has been added.

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