【问题标题】:Symfony HWIOAuthBundle - How to disbable automatic logout?Symfony HWIOAuthBundle - 如何禁用自动注销?
【发布时间】:2016-01-09 18:14:29
【问题描述】:

我使用HWIOAuthBundle 让用户使用他们的社交帐户登录。一旦用户登录,它会在 30 分钟左右后注销。

知道如何禁用它以便他们永远保持登录状态吗?

【问题讨论】:

  • 对我来说,解决方案在 security.yml security: firewalls: main: remember_me: key: %secret% lifetime: 31536000 # 365 days in seconds

标签: symfony timeout logout hwioauthbundle


【解决方案1】:

在你的配置中设置cookie_lifetime

# app/config/config.yml
framework:
    session:
        #lifetime in seconds
        cookie_lifetime: 3600

请参阅Framework configuration 了解更多信息。如果您想让您的用户永久登录,您可能还想考虑实现“记住我”功能,请参阅here 了解更多信息

【讨论】:

    【解决方案2】:

    使用防火墙中的 remember_me 或仅将 cookie_lifetime 添加到 1 年,具体取决于您的设计模式

     firewalls:
         secured_area:   
             remember_me:
                lifetime: 31536000 #1 year 
    

    【讨论】:

      猜你喜欢
      • 2018-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多