How to log users off automatically after a period of inactivity?

后端 未结 9 1849
心在旅途
心在旅途 2020-11-27 03:21

After a lot of search in the web and find nothing, I wonder if there is an easy way to automatic logout the user logged through the Symfony Security after an inactive period

9条回答
  •  借酒劲吻你
    2020-11-27 04:01

    In Symfony 2.4, the following worked just fine for me for a 1 hour time out :

    framework:
        #esi:             ~
        translator:      { fallback: %locale% }
        secret:          %secret%
        router:
            resource: "%kernel.root_dir%/config/routing.yml"
            strict_requirements: ~
            http_port: 80
            https_port: 443
        form:            ~
        csrf_protection: ~
        validation:      { enable_annotations: true }
        templating:
            engines: ['twig']
            #assets_version: SomeVersionScheme
        default_locale:  "%locale%"
        trusted_proxies: ~
        session:         
            cookie_lifetime:       3600
        fragments:       ~
        trusted_hosts:   ~
    

提交回复
热议问题