Skip to content
Browse files

Override rack's destroy_session in cookie store

  • Loading branch information...
1 parent 54a0b01 commit 7fd6bd69e65b8cf9b844c46b98f79fb4b13b1c6a @alup alup committed with steveklabnik Sep 1, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
View
8 actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
@@ -44,6 +44,14 @@ class CookieStore < Rack::Session::Cookie
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)

0 comments on commit 7fd6bd6

Please sign in to comment.
Something went wrong with that request. Please try again.