chr*_*hey 7 mysql session load-balancing symfony
我继承了一个symfony2项目,它在实时环境中运行在2个以上的负载平衡服务器上.会话存储在应用程序使用的mysql数据库中.
我遇到的问题是,在有CSRF保护的表单上,有时令牌回来无效.我猜这是因为生成令牌的服务器并不总是获取表单POST的服务器,并且无法匹配正在发送的令牌.
我对symfony非常非常新,并尝试了一些不同的解决方案来使用Symfony框架中的session和SessionCsrfProvider生成令牌.
任何人都可以指出我正确的方向或有类似的问题吗?
CsrfProviders 将通过连接密钥(来自parameters.ini)+意图(默认为null)+会话id来生成令牌。
By default, symfony is configured to use the SessionCsrfProvider, which uses the session storage id.
If you are using the PDOSessionStorage or NativeSessionStorage object, it will return the session_id().
It could mean your session_id() is not the same depending on what machine handles the request.
| 归档时间: |
|
| 查看次数: |
2271 次 |
| 最近记录: |