简体   繁体   English

使用fosuserbundle进行会话时如何重定向到登录页面?

[英]How to redirect to login page when session out using fosuserbundle?

I'm using fosuserbundle for login page in symfony 3. I'm studying their documentation ( link ) and follow their instructions. 我正在使用symfony 3中的fosuserbundle作为登录页面。我正在研究他们的文档( 链接 )并按照他们的说明进行操作。 I have already a login form. 我已经有一个登录表格。 It work fine when login, but there is no sample here that will limit the session timeout and then will redirect to login page if session is out. 登录时工作正常,但此处没有示例将限制会话超时,如果会话超时,则将重定向到登录页面。 I don't know if there are configuration that need to work this, I don't want to use the native PHP session like this one 我不知道是否需要进行配置,我不想使用像这样的本机PHP会话

session_start();

It will be glad if you have tutorials that will guide me on how to work in this problem. 如果您有可以指导我如何解决此问题的教程,将非常高兴。

您可以在配置中定义生命周期,例如在symfony文档中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM