在以下相关配置中security.yml
:
security:
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern:
form_login:
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
logout: true
anonymous: true
logout_on_user_change: true
remember_me:
secret: '%secret%'
secure: true
httponly: true
lifetime: 31536000
记住我会话令牌仅对浏览器会话有效,而不是配置中指定的年份。会不会是secure: true
设置的原因?我的开发机器没有安装任何 TLS,这可能是罪魁祸首吗?或者还有什么我应该寻找的吗?从查看文档来看,我似乎设置正确,所以我有点不知所措。
原来我的直觉secure: true
是正确的。我false
在测试期间将其设置为,并且 cookie 是正确的。由于我的开发机器没有 SSL/TLS,如果这是配置的话,它无法发送安全 cookie。它应该可以在我的生产服务器上运行,因为我确实在该环境中使用了 SSL/TLS。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句