Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Security] Track session usage whenever a new token is set#36335
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
a7eb8fc toc1e0d9eComparenicolas-grekas commentedApr 3, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Can't we make setToken increment the trackerwhen $token is not null? |
wouterj commentedApr 3, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I just tried this (as it sounds like a nice solution), but without calling Allowing |
c1e0d9e tofed965aCompare20b8804 tod09adf8Compared09adf8 to8d96dbdComparefabpot commentedApr 4, 2020
Thank you@wouterj. |
Uh oh!
There was an error while loading.Please reload this page.
When using
anonymous: lazy, the programatic login using the guard handler is broken. As thesetToken()does not track usage, the index remains equal.I tried fixing this more properly in e.g. the
SessionStrategy::onAuthenticationclass, but I couldn't get it working (as$request->hasPreviousSession()returns false, the session strategy isn't called).setToken()can also not be made usage tracking afaics, because it would directly break (setToken(null)is called inContextListener).The current fix does however look really ugly, but I can't find anything better with my minor knowledge of this session usage tracking feature. I'm open for all ideas :)