-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Do not store user session if it has not already been initialized #1293
Conversation
|
I am pretty sure that the fix is wrong. core-bundle/src/EventListener/UserSessionListener.php Lines 79 to 85 in e4f0d29
The user object is incomplete upon login, because it has not been created via
So in your approach, the session will be empty for the login request! And we don't know if there are other listeners (e.g. storing the referer) that also rely on the session not being empty? |
This cannot be true. First of all, the login process obviously does not have a token in the session, otherwise a login would not be required. So there is nothing to be unserialized or incomplete. On subsequent requests the user is unserialized from the session, but the |
|
I have dumped the user object in line 86: You are right that the object is not incomplete (e.g. |
|
Maybe the session data is simply not unserialized? |
|
The session data is never serialized so it cannot be unserialized, can it? |
|
It sure is serialized, |
|
I'm talking about this: core-bundle/src/Resources/contao/library/Contao/User.php Lines 642 to 645 in e4f0d29
|
|
I have added the changes (with unit test) in 5a721c6. Although it works, I don't like that the listener is now stateful. Is this ok for us? |
|
The only other option I can think of is to only register the |
|
Brilliant. Changed in 82b22c9. |
see #1288