diff --git a/lib/devise/rails/warden_compat.rb b/lib/devise/rails/warden_compat.rb index c352023f..85df1601 100644 --- a/lib/devise/rails/warden_compat.rb +++ b/lib/devise/rails/warden_compat.rb @@ -20,6 +20,13 @@ class Warden::SessionSerializer def deserialize(keys) klass, id = keys + + if klass.is_a?(Class) + raise "Devise changed how it stores objects in session. If you are seeing this message, " << + "you can fix it by changing one character in your cookie secret, forcing all previous " << + "cookies to expire, or cleaning up your database sessions if you are using a db store." + end + klass.constantize.find(:first, :conditions => { :id => id }) rescue NameError => e if e.message =~ /uninitialized constant/