diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2014-07-09 21:49:37 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2014-08-04 11:36:43 -0300 |
commit | 11fd052aa815ae0255ea5b2463e88138fb3fec61 (patch) | |
tree | 65dee5d7cd5171e10da54f9e4e15e394a62b5a2b /actionpack/lib/action_dispatch | |
parent | c43f20a4048ff2b245f8f163c2f9642f56c697a0 (diff) | |
download | rails-11fd052aa815ae0255ea5b2463e88138fb3fec61.tar.gz rails-11fd052aa815ae0255ea5b2463e88138fb3fec61.tar.bz2 rails-11fd052aa815ae0255ea5b2463e88138fb3fec61.zip |
Regenerate sid when sbdy tries to fixate the session
Fixed broken test.
Thanks Stephen Richards for reporting.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/session/cache_store.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/session/cache_store.rb b/actionpack/lib/action_dispatch/middleware/session/cache_store.rb index 1db6194271..625050dc4b 100644 --- a/actionpack/lib/action_dispatch/middleware/session/cache_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/cache_store.rb @@ -16,9 +16,9 @@ module ActionDispatch # Get a session from the cache. def get_session(env, sid) - sid ||= generate_sid - session = @cache.read(cache_key(sid)) - session ||= {} + unless sid and session = @cache.read(cache_key(sid)) + sid, session = generate_sid, {} + end [sid, session] end |