0

With Symfony 3.3.16, my users are disconnected in 5/6 minutes. I don't understand.

This problem is only in production (OVH), not in dev.

session.gc_maxlifetime : 1440

security.yml :

security:
    encoders:
        AppBundle\Entity\User: bcrypt

    providers:
        database_users:
            entity:
                class: AppBundle\Entity\User

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        main:
            pattern: ^/

            anonymous: true

            simple_form:
                username_parameter: _email
                authenticator: AppBundle\Security\Authenticator
                check_path: login
                login_path: login
                success_handler: AppBundle\Handler\AuthenticationSuccessHandler

            logout:
                path: logout
                handlers: [AppBundle\Handler\LogoutHandler]
                success_handler: AppBundle\Handler\LogoutSuccessHandler

    access_control:
        - { path: '^/administration', roles: ROLE_ADMIN }
        - { path: '^/user', roles: ROLE_USER }

Can you help me ?

Gaylord.P
  • 1,539
  • 2
  • 24
  • 54

1 Answers1

0

In the symfony configuration reference, you can configure the session lifetime setting:

cookie_lifetime

This determines the lifetime of the session - in seconds. The default value - null - means that the session.cookie_lifetime value from php.ini will be used. Setting this value to 0 means the cookie is valid for the length of the browser session.

gc_maxlifetime

This determines the number of seconds after which data will be seen as "garbage" and potentially cleaned up. Garbage collection may occur during session start and depends on gc_divisor and gc_probability.

Check their value in the config.yml and config_prod.yml

I understand you have already checked the the value of the php.ini value session.gc_maxlifetime

Community
  • 1
  • 1
goto
  • 7,908
  • 10
  • 48
  • 58