diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-04 14:23:32 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-04 14:23:32 +0100 |
commit | b538b3c6519bd5dc026c488bbeab683695abc320 (patch) | |
tree | 74cd7e82c569b12d0e3f28fc18655dbca90ccbd0 | |
parent | fd132ece1fc6792eaf4872703ad40fe926ed3434 (diff) | |
download | zorglub-b538b3c6519bd5dc026c488bbeab683695abc320.zip zorglub-b538b3c6519bd5dc026c488bbeab683695abc320.tar.gz |
session: add #destroy!
-rw-r--r-- | lib/zorglub/session.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/zorglub/session.rb b/lib/zorglub/session.rb index a20dfcc..8162cf1 100644 --- a/lib/zorglub/session.rb +++ b/lib/zorglub/session.rb @@ -28,6 +28,11 @@ module Zorglub @session_data = SessionHash.data[sid]||={} end # + def destroy! + SessionHash.data.delete @sid + @session_data = nil + @sid = nil + end # def [] idx @session_data[idx] @@ -66,6 +71,12 @@ module Zorglub end private :setup! # + def destroy! + @response.delete_cookie Session.key + @instance.destroy! if @instance + @instance = nil + end + # def sid setup! if @instance.nil? return nil if @instance.nil? |