From 54e443dfada3f08350441edb32477bda6112ebc6 Mon Sep 17 00:00:00 2001 From: Martin Doucha Date: Sat, 28 May 2016 21:54:24 +0200 Subject: [PATCH 1/2] Ignore internal attributes when checking whether new session was changed --- gluon/globals.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gluon/globals.py b/gluon/globals.py index b8fd240a..d177d6e2 100644 --- a/gluon/globals.py +++ b/gluon/globals.py @@ -1136,6 +1136,12 @@ class Session(Storage): return True def _unchanged(self, response): + if response.session_new: + internal = ['_last_timestamp', '_secure', '_start_timestamp'] + for item in self.keys(): + if item not in internal: + return False + return True session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL) response.session_pickled = session_pickled session_hash = hashlib.md5(session_pickled).hexdigest() From 40b8a4d75dfc9a9a8538176456a283a05f687d95 Mon Sep 17 00:00:00 2001 From: Martin Doucha Date: Sat, 28 May 2016 22:25:58 +0200 Subject: [PATCH 2/2] Whitespace fix --- gluon/globals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon/globals.py b/gluon/globals.py index d177d6e2..be1e48c7 100644 --- a/gluon/globals.py +++ b/gluon/globals.py @@ -1137,7 +1137,7 @@ class Session(Storage): def _unchanged(self, response): if response.session_new: - internal = ['_last_timestamp', '_secure', '_start_timestamp'] + internal = ['_last_timestamp', '_secure', '_start_timestamp'] for item in self.keys(): if item not in internal: return False