Symfony2从ssl子域注销

时间:2015-03-11 17:41:22

标签: php symfony ssl

我被迫使用子域进行ssl连接。

我解决登录/注销过程的想法是使用路由配置在ssl-subdomain上“重定向”并使用https。注销过程应该相反:“重定向”到原始域并使用http。 一切正常,除了用户在注销过程后仍然登录。

我的routing.yml看起来像:

userarea:
    resource: "@BlueChordUserBundle/Controller/"
    type:     annotation
    schemes:  [https]
    host:     example.hosted-secure.com
    prefix:   /

adminarea:
    resource: "@BlueChordAdminBundle/Controller/"
    type:     annotation
    schemes:  [https]
    host:     example.hosted-secure.com
    prefix:   /

website:
    resource: "@BlueChordWebsiteBundle/Controller/"
    type:     annotation
    prefix:   /

login_check:
    path:   /{_lang}/dashboard/login_check
    schemes:  [https]
    host:     example.hosted-secure.com

logout:
    path:   /{_lang}/dashboard/logout
    schemes:  [http]
    host:     example.com

loginfailure:
    path:   /{_lang}/login
    schemes:  [https]
    host:     example.hosted-secure.com

我在这里发现了或多或少类似的问题,但没有人提供帮助。

1 个答案:

答案 0 :(得分:1)

由于Cookie域限制,它无法正常工作。您的会话cookie将保存在客户端浏览器中的domain hosted-secure.com域中。如果您将用户重定向到example.com上的注销操作,则客户端浏览器不会将会话cookie发送到服务器。 example.com根本看不到会话cookie。

在ssl子域下进行注销操作并在成功注销后重定向到原始http域怎么样?