Closed andrzejdziekonski closed 4 years ago
did you find the solution for this problem? I have the same !!
did you find the solution?
Yes, i found the reason. My User class implemented Equatable and my equalTo method did not work the same way it used to in legacy version of php/symfony. So when function returned false here i was immidiately logged out. I refactored the method and it works perfectly.
From my research similiar behaviour is related to wrong serialization/deserialization so you might check this area.
Symfony FOSUserBundle versions:
Description of the problem including expected versus actual behavior: After upgrading my application from 3.4 to 4.4 i got login issue. During successful authorization i can debug and see correctly all the user information from session token in onAuthenticationSuccess() function of my LoginSuccessHandler class which is passed to fos_user via config. The function returnse redirectResponse and in the provided route session token is gone and user is annonymous so in fact i login successfuly then somehow invalidate my session and i am back to login page. Any tips how can i track where i lose my session info? I tried both redis session storage and local native_file with no success.
I can provide some logs from profiler but i am not sure which are relevant.
Here is my fos_user and security configuration