From 627a721cf6819a118997e3e3f448e89903dacbf2 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Sun, 24 Mar 2013 14:47:02 -0400 Subject: [PATCH] Delete the session cookie on an empty session. --- mediagoblin/tools/session.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mediagoblin/tools/session.py b/mediagoblin/tools/session.py index 676bc43e..303907b9 100644 --- a/mediagoblin/tools/session.py +++ b/mediagoblin/tools/session.py @@ -57,4 +57,7 @@ class SessionManager(object): def save_session_to_cookie(self, session, response): if not session.is_updated: return - response.set_cookie(self.cookie_name, self.signer.dumps(session)) + elif not session: + response.delete_cookie(self.cookie_name) + else: + response.set_cookie(self.cookie_name, self.signer.dumps(session)) -- 2.25.1