Created
March 20, 2009 21:54
-
-
Save caffo/82602 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ActionControllerExtensions | |
def self.included(base) | |
base::Dispatcher.send :include, DispatcherExtensions | |
end | |
module DispatcherExtensions | |
def self.included(base) | |
base.send :before_dispatch, :set_session_domain | |
end | |
def set_session_domain | |
ApplicationController.session_options.update :session_domain => "#{@request.host.gsub(/^[^.]*/, '')}" unless request.host.match /\.localhost$/ | |
end | |
end | |
end | |
ActionController.send :include, ActionControllerExtensions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment