I am using Devise to manage authentication in a Rails 3.1 application. It works just fine in my production server. But I just set up a new test server, and if I log in to the main site, accessing a subdomain is not recognizing the session. It’s asking me to log in again.
I can’t recall where I would troubleshoot this information. It seems as if it is some cookie setting.
I have domains pointed to each site, production and test. The production one ends in .net, the test version ends in .co.
Can anyone point me in the right direction?
I think this is not a devise setting but a session and cookie setting.
You can work on this by setting the variable
YourApp::Application.config.sessionYou can do this in your
environment.rbfile or yourconfig/initializers/session_store.rb. Example for session_store.rb isPlease note the
session_domainsetting it to.yourdomain.commakes your cookies work across subdomains.This applies to sessions. There are similiar settings for cookies.