diff --git a/lib/devise/controllers/ssl_session_verifiable.rb b/lib/devise/controllers/ssl_session_verifiable.rb
index <HASH>..<HASH> 100644
--- a/lib/devise/controllers/ssl_session_verifiable.rb
+++ b/lib/devise/controllers/ssl_session_verifiable.rb
@@ -20,6 +20,8 @@ module Devise
       def secure_ssl_session?(resource)
         scope = Devise::Mapping.find_scope!(resource)
         cookies.signed_or_encrypted[ssl_session_verification_key(scope)] == resource.id
+      rescue => err
+        cookies.delete(ssl_session_verification_key(scope), base_ssl_session_verification_cookie_values(resource))
       end
 
       def set_ssl_session_verification_cookie(resource)
rescue errors when trying to load the cookie and reset it