[英]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.