[英]How to configure symfony2 session lifetime
如果您想在Symfony2中构建一个记住我的功能,您可以在symfony2配置中为此功能定义更长的生命周期。 有关其他信息,请参阅文档 。 示例也取自那里。
# app/config/security.yml
security:
# ...
firewalls:
main:
# ...
remember_me:
secret: '%secret%'
lifetime: 604800 # 1 week in seconds
path: /
# by default, the feature is enabled by checking a
# checkbox in the login form (see below), uncomment the
# following line to always enable it.
#always_remember_me: true
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.