diff options
author | Andreas Loupasakis <andreas@aloop.org> | 2012-09-01 14:21:49 +0300 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2012-09-01 16:35:42 -0700 |
commit | 7fd6bd69e65b8cf9b844c46b98f79fb4b13b1c6a (patch) | |
tree | 4df3bbd5046286d111309f5f6c0a380c6af98339 /actionpack/lib/action_dispatch | |
parent | 54a0b01f760354ee8002d136b322d6ea429b67f6 (diff) | |
download | rails-7fd6bd69e65b8cf9b844c46b98f79fb4b13b1c6a.tar.gz rails-7fd6bd69e65b8cf9b844c46b98f79fb4b13b1c6a.tar.bz2 rails-7fd6bd69e65b8cf9b844c46b98f79fb4b13b1c6a.zip |
Override rack's destroy_session in cookie store
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/session/cookie_store.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb index 9b159b2caf..019849ef95 100644 --- a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb @@ -44,6 +44,14 @@ module ActionDispatch include StaleSessionCheck include SessionObject + # Override rack's method + def destroy_session(env, session_id, options) + new_sid = super + # Reset hash and Assign the new session id + env["action_dispatch.request.unsigned_session_cookie"] = new_sid ? { "session_id" => new_sid } : {} + new_sid + end + private def unpacked_cookie_data(env) |