Ignore exceptions clearing sessions
Rails 3 sessions can't be loaded by rails 4 but reset_session also fails because it tries to clear the session, which tries to load it in to clear it. So monkey patch the session to ignore exceptions during clear so that out normal reset-on-exception logic will reset the session.
This commit is contained in:
parent
d8a504d8db
commit
90048d87d6
1 changed files with 13 additions and 0 deletions
13
config/initializers/session.rb
Normal file
13
config/initializers/session.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
module ActionDispatch
|
||||
class Request < Rack::Request
|
||||
class Session
|
||||
def clear_with_rescue
|
||||
clear_without_rescue
|
||||
rescue
|
||||
# lets not worry about it...
|
||||
end
|
||||
|
||||
alias_method_chain :clear, :rescue
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue