简体   繁体   中英

WWW and non-WWW URL. Two different sites?

I am noticing that my sites session cookies are different between the two. If someone logs in on the www.mysite.com they are not logged in on the non www site. 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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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