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:33:19 -0300 |
commit | 930110b0452bd33e0ee54e9ec6d68e904ba7a0ad (patch) | |
tree | fbd53eade3a2767b8a7a89ec9751201686c873b2 /actionpack/lib/action_dispatch/middleware | |
parent | b2e88043b52a8f83820a0f4e8a65aa42fd40c544 (diff) | |
download | rails-930110b0452bd33e0ee54e9ec6d68e904ba7a0ad.tar.gz rails-930110b0452bd33e0ee54e9ec6d68e904ba7a0ad.tar.bz2 rails-930110b0452bd33e0ee54e9ec6d68e904ba7a0ad.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/middleware')
-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 |