Set a starting value for session.send_new_cookie.

This makes session.__init__ slightly more complicated but probably
simplifies everything else, especially if we make the class smarter
later by having it track changes itself.
This commit is contained in:
Brett Smith 2013-03-24 15:39:49 -04:00
parent 9e1fa2396f
commit 5d1a8815d1

View File

@ -22,11 +22,15 @@ import crypto
_log = logging.getLogger(__name__)
class Session(dict):
def __init__(self, *args, **kwargs):
self.send_new_cookie = False
dict.__init__(self, *args, **kwargs)
def save(self):
self.send_new_cookie = True
def is_updated(self):
return getattr(self, 'send_new_cookie')
return self.send_new_cookie
def delete(self):
self.clear()