So I have two heroku apps:
- http://production-app.com (mapped from http://production-app.heroku.com)
- http://development-app.heroku.com
On production-app.com
, I have several subdomains using the Heroku custom domains addon with Zerigo (not the wildcard domain addon):
On development-app.heroku.com
, I also have those custom subdomains, but since I don't have a custom domain, I just use the wildcard addon.
In my routes.rb
, using Subdomain-Fu, I have the subdomains working locally and on both Heroku apps.
The issue I'm facing now is, how do I keep the session in sync between all the subdomains?
I have tried adding this to production.rb
:
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:session_domain => '.production-app.com')
And even combinations of this:
begin
config.action_controller.session[:domain] = '.production-app.com'
config.action_controller.session[:session_domain] = '.production-app.com'
rescue
config.action_controller.session = {:domain => '.production-app.com', :session_domain => ".production-app.com"}
end
...and for the dev site, both of these:
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:session_domain => '.heroku.com')
# or
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:session_domain => '.development-app.heroku.com')
None of those keep the session between subdomains. How do I get this working when I have a custom domain and when I'm just running off a Heroku subdomain?
Thanks!