Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@loe
Created April 23, 2012 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loe/2473863 to your computer and use it in GitHub Desktop.
Save loe/2473863 to your computer and use it in GitHub Desktop.
Monkey Patch Rails 2.3 reset_session to work correctly (especially if you use something like Intercession)
class ActionController::Request
def reset_session
by = session.instance_variable_get(:@by)
session.destroy if session and session.respond_to?(:destroy)
self.session = ActionController::Session::AbstractStore::SessionHash.new(by, @env)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment