Skip to content

Instantly share code, notes, and snippets.

@aslam
Created December 10, 2010 06:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aslam/735857 to your computer and use it in GitHub Desktop.
Save aslam/735857 to your computer and use it in GitHub Desktop.
Rails 3 reset session using devise (actually not using devise)
class ApplicationController < ActionController::Base
...
before_filter :save_or_clear_session
def save_or_clear_session
if controller_name.eql?('sessions') and action_name.eql?('destroy')
request.reset_session
flash[:notice] = "Signed out successfully."
end
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment