Deekor
Deekor

Reputation: 9499

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?

Upvotes: 2

Views: 177

Answers (2)

Deekor
Deekor

Reputation: 9499

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

Upvotes: 0

yxf
yxf

Reputation: 493

Add domain for cookie like this:

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

Upvotes: 1

Related Questions