简体   繁体   English

WWW和非WWW URL。 两个不同的网站?

[英]WWW and non-WWW URL. Two different sites?

I am noticing that my sites session cookies are different between the two. 我注意到我的网站会话Cookie在两者之间是不同的。 If someone logs in on the www.mysite.com they are not logged in on the non www site. 如果有人登录www.mysite.com他们不会登录non www网站。 How can I fix this? 我怎样才能解决这个问题?

为Cookie添加域,如下所示:

cookies[:key] = {:value=>val,:domain=>'.mysite.com'}

config/initializers/session_store.rb , :domain => ".yourdomain.com"Application.config.session_store行的末尾添加, :domain => ".yourdomain.com"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM