Skip to content

Instantly share code, notes, and snippets.

@kagemusha
Created December 21, 2011 04:43
Show Gist options
  • Save kagemusha/1504625 to your computer and use it in GitHub Desktop.
Save kagemusha/1504625 to your computer and use it in GitHub Desktop.
Invalidate Session when SessionRestoreError in Rails 3.x
Tested on: Rails 3.1
If have error:
ActionDispatch::Session::SessionRestoreError (Session contains objects whose class definition isn't available.
Remember to require the classes for all objects kept in the session.
can fix by changing a char in secret token in initializers/secret_token.rb
MyApp::Application.config.secret_token
In my case this resulted from migrating to another database which used different types which were getting cached.
@artemave
Copy link

+1

@jagdeepsingh
Copy link

This still works. +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment