Rails 问个 Subdomain 情况下用户登陆 session 共享的问题

zhangner · June 09, 2013 · Last by TsingHan replied at June 13, 2013 · 1942 hits

在 routes 里面用 constraints 配置了几个 subdomain,然后在 session_store.rb 中添加了 domain: '.exampl.com'这段,其中的 example 为线上实际的域名。用 devise 插件做的登陆等,但是登陆之后在其他 subdomain 下都取不到用户 session。 看了下 https://github.com/RailsApps/rails3-subdomains 这个 demo 也没看出什么名堂,求指点。

自己顶下别沉了,求指点。

把 cookie 的 path 设置成 '/' 试试

You need to Sign in before reply, if you don't have an account, please Sign up first.