From 18601c4f72c32fd191b7105a375c5750e86b5ef1 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Thu, 22 Aug 2013 02:38:49 -0500 Subject: [PATCH] solved problems with auth and cookie expire --- VERSION | 2 +- gluon/globals.py | 5 ++++- gluon/tools.py | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 69a64054..3332cfac 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.6.0-development+timestamp.2013.08.22.02.31.01 +Version 2.6.0-development+timestamp.2013.08.22.02.36.56 diff --git a/gluon/globals.py b/gluon/globals.py index 4cc1b388..89707f8f 100644 --- a/gluon/globals.py +++ b/gluon/globals.py @@ -917,9 +917,12 @@ class Session(Storage): if response.session_id: rcookies[response.session_id_name] = response.session_id rcookies[response.session_id_name]['path'] = '/' - if response.session_cookie_expires: + if isinstance(response.session_cookie_expires,datetime.datetime): rcookies[response.session_id_name]['expires'] = \ response.session_cookie_expires.strftime(FMT) + elif isinstance(response.session_cookie_expires,str): + rcookies[response.session_id_name]['expires'] = \ + response.session_cookie_expires def clear(self): previous_session_hash = self.pop('_session_hash', None) diff --git a/gluon/tools.py b/gluon/tools.py index 7c47b1c7..1361f0b8 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -1225,8 +1225,7 @@ class Auth(object): response = current.response if auth and auth.remember: # when user wants to be logged in for longer - response.cookies[response.session_id_name]["expires"] = \ - auth.expiration + response.session_cookie_expires = auth.expiration if signature: self.define_signature() else: