From b538b3c6519bd5dc026c488bbeab683695abc320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 4 Jan 2012 14:23:32 +0100 Subject: session: add #destroy! --- lib/zorglub/session.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) 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? -- cgit v1.1-2-g2b99