Skip to content

Instantly share code, notes, and snippets.

@blech75
Created October 21, 2011 18:28
Show Gist options
  • Save blech75/1304567 to your computer and use it in GitHub Desktop.
Save blech75/1304567 to your computer and use it in GitHub Desktop.
ugly hack to set subdomain cookies in Rails 1.2 apps
module SubdomainSessions
def self.included(base)
base.class_eval do
alias_method_chain :session_options_with_string_keys, :subdomain_sessions
end
end
def session_options_with_string_keys_with_subdomain_sessions
@session_options[:session_domain] = "." + host;
@session_options_with_string_keys ||= ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.merge(@session_options).stringify_keys
end
end
ActionController::CgiRequest.send(:include, SubdomainSessions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment