Symfony2 注销问题 [英] Symfony2 logout issue

查看:34
本文介绍了Symfony2 注销问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Symfony2 中测试安全环境并且在注销过程中遇到问题

I am testing Security environnement within Symfony2 and hav problem with log out process

这是我的 security.yml 文件

Here is my security.yml file

security:
firewalls:
    secured_area:
            pattern:    ^/
            anonymous: ~
            switch_user: true
            logout: 
                path: /logout
                target: /
            http_basic:
                realm: "Secured Demo Area"

access_control:
    - { path: ^/item, roles: [ 'ROLE_USER' ]  }

providers:
    in_memory:
        users:
            collector:  { password: collector, roles: 'ROLE_USER' }
            admin: { password: admin, roles: 'ROLE_ADMIN' }

encoders:
    Symfony\Component\Security\Core\User\User: plaintext

问题是,当我转到 mysite.site/app_dev.php/logout 时,它确实将我重定向到目标",但没有注销活动用户.

Problem is that when I go to mysite.site/app_dev.php/logout it does redirect me to "target" but does not log out active user.

有人知道我错在哪里了吗?

Does anyone know where am i wrong ?

推荐答案

由于您使用的是 HTTP 身份验证,原因可能是您的浏览器缓存了您的凭据并自动重新登录.尝试使用 HTML 表单身份验证,看看问题是否仍然存在.

Since you are using HTTP authentication, the reason might be that your browser caches your credentials and relogins automatically. Try using HTML form authentication and see if the problem persists.

这篇关于Symfony2 注销问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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