Symfony 2“您的会话已超时或您已禁用Cookie" [英] Symfony 2 "Your session has timed out or you have disabled cookies"

查看:127
本文介绍了Symfony 2“您的会话已超时或您已禁用Cookie"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

造成这种情况的三件事之一,但我不确定这是哪三件事.因此,我将提及这3个,希望它能帮助其他人节省时间.

One of three things caused this and I am not sure which of the 3 it was. So I will mention all 3 in the hope it will help others save time.

最初,我在parameters.yml中更改了数据库用户凭据. 由于相关用户无法从本地主机登录,因此无法正常工作.就是说,我使用该网站测试了连接,这可能会使cookie崩溃.

Initially I changed database user credentials within parameters.yml This wasn't working as the user in question couldn't log in from localhost. That said, I used the site to test the connection, which might have upset the cookie.

由于缺少图像,我遇到了一些缓存文件夹权限问题.因此,我必须像每次一样清除缓存并调整一些权限.

I had some cache folder permissions issues due to a missing image. So I had to clear the cache and adjust some permissions as you do every time.

最后,我更改了security.yml的路径

Finally, I changed the paths for security.yml

        form_login:
            login_path:  /login
            check_path:  /login_check
        logout:
            path:   /logout

收件人:

        form_login:
            login_path:  /account/login
            check_path:  /account/login_check
        logout:
            path:   /account/logout

在routing.yml中进行了适当的更改

Along with the appropriate changes in routing.yml

结果是我已经登录的用户不再通过安全证书,并且如果我尝试通过其他用户/浏览器登录,我将始终面临: 您的会话已超时或您已禁用Cookie"

The result was that my already logged in user not longer passed security credentials and if I tried to login in via a different user/browser, I was always faced with: "Your session has timed out or you have disabled cookies"

红色鲱鱼,检查安全性,登录处理,redis等花费了许多时间.

Many many hours were spent following red herrings, checking security, login handling, redis etc.

下面的答案.

推荐答案

我最终在这里找到了答案: Symfony身份验证-无法越过登录页面生产中(pleerock的答案)

I ultimately found the answer here: Symfony authentication - can't get past login page in production (The answer by pleerock)

但是想将我的主题行中的错误消息与以下解决方案链接起来:

But wanted to link the error message in my subject line with this solution below:

security:
    firewalls:
        main:
            form_login:
                require_previous_session: false

这解决了问题之前未登录的浏览器的问题.

This fixed the issue for browsers which hadn't been logged in prior to the problem.

对于已经登录的浏览器,我必须手动删除会话cookie才能使一切恢复正常.

For my browser which had already been logged in, I had to manually delete the session cookie to get things working again.

这篇关于Symfony 2“您的会话已超时或您已禁用Cookie"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆