Created
October 21, 2011 18:28
-
-
Save blech75/1304567 to your computer and use it in GitHub Desktop.
ugly hack to set subdomain cookies in Rails 1.2 apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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