2

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?

Deekor
  • 9,144
  • 16
  • 69
  • 121

2 Answers2

1

Add domain for cookie like this:

cookies[:key] = {:value=>val,:domain=>'.mysite.com'}
yxf
  • 485
  • 2
  • 5
0

in config/initializers/session_store.rb add , :domain => ".yourdomain.com" to the end of the Application.config.session_store line.

Deekor
  • 9,144
  • 16
  • 69
  • 121