Rails 3.2.8 - Share development sessions through subdomains using POW

I am trying to create a simple subdomain blog in rails 3.2.8. These will mainly be sites, users (authenticated through Devise), and membership to connect users to sites. I installed POW so myapp.dev works correctly. Each site has a subdomain, and I can proceed to # show show using subdomains without any problems. My problem is that I cannot use development sessions for subdomains. Everything works fine in my heroku application, but I would like to be able to test this locally.

When I add the following to session_store.rb, the sessions seem to work on subdomains, but then I cannot log out.

Appname::Application.config.session_store :cookie_store, :key => '_appname_session', domain: :all

When I change the end of the domain: ".appname.dev", it does not work.

Any help would be greatly appreciated!

+5
source share
1 answer

Make sure you clear the cookies and restart the application.

Appname::Application.config.session_store :cookie_store, :key => '_appname_session', domain: ".appname.dev"

domain: ".appname.dev"- The correct format for the domain option. The initial period is important.

+5
source

All Articles