If a user gets logged out (due to session expiration or for other reasons) in the background while using my Symfony2 application, I have implemented a JS layer appearing on
To me the easier solution is to redirect user on the same form, passing data alredy inserted via POST.
In that way the token will be generated again in an automatic way.
Moreover, you'll not lost data input.