diff options
author | Michael Lovitt <michael@lovitt.net> | 2010-06-22 09:55:50 -0400 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-06-23 11:56:35 -0700 |
commit | 49f52c3d910c8f183afc3a54ea2ae9667f23085e (patch) | |
tree | 410bc3c8fb8921397547c33fd8661f2015065946 /activerecord/lib/active_record | |
parent | 0bf3baa6b3d216c6340f8d3b5d0a3ebc093e969a (diff) | |
download | rails-49f52c3d910c8f183afc3a54ea2ae9667f23085e.tar.gz rails-49f52c3d910c8f183afc3a54ea2ae9667f23085e.tar.bz2 rails-49f52c3d910c8f183afc3a54ea2ae9667f23085e.zip |
Sessions should not be created until written to and session data should be destroyed on reset.
[#4938]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/session_store.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/session_store.rb b/activerecord/lib/active_record/session_store.rb index f712a2c94f..b88d550086 100644 --- a/activerecord/lib/active_record/session_store.rb +++ b/activerecord/lib/active_record/session_store.rb @@ -318,6 +318,14 @@ module ActiveRecord sid end + def destroy(env) + if sid = current_session_id(env) + Base.silence do + get_session_model(env, sid).destroy + end + end + end + def get_session_model(env, sid) if env[ENV_SESSION_OPTIONS_KEY][:id].nil? env[SESSION_RECORD_KEY] = find_session(sid) |