I am facing an weird issue,sometimes when an user weather he is active or not reloads the page or click on any other page,the session logs out. I am using FOS User Bundle here.Also,in that case the webpage loads the half of the expected page and half of the login page. This leads to a broken design. So I have 2 problems here:
- Unexpected session timeout.
- Loading of two twig files at the same time. I assume symfony security tries to loads the login page once it finds the session is timed out,at the same time where the current file was loading.
This is how my config.yml file session section looks like.
framework: #esi: ~ #translator: { fallback: "%locale%" } secret: "%secret%" router: resource: "%kernel.root_dir%/config/routing.yml" strict_requirements: ~ form: ~ csrf_protection: ~ validation: { enable_annotations: true } templating: engines: ['twig'] #assets_version: SomeVersionScheme default_locale: "%locale%" trusted_hosts: ~ trusted_proxies: ~ session: # handler_id set to null will use default session handler from php.ini # handler_id: ~ handler_id: session.handler.native_file save_path: "%kernel.root_dir%/sessions" # to avoid this error- Symfony2 and ContextErrorException: Warning: SessionHandler::read() Exception fragments: { path: /_fragment } http_method_override: true