Dolda2000 GitWeb
/
wrw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
188da53
)
Don't send session cookie unless session is dirty.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 27 May 2011 00:18:23 +0000
(
02:18
+0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 27 May 2011 00:18:23 +0000
(
02:18
+0200)
wrw/session.py
patch
|
blob
|
blame
|
history
diff --git
a/wrw/session.py
b/wrw/session.py
index
1fded4a
..
9e91ad9
100644
(file)
--- a/
wrw/session.py
+++ b/
wrw/session.py
@@
-129,18
+129,17
@@
class db(object):
except KeyError:
sess = session()
self.live[sess.id] = sess
except KeyError:
sess = session()
self.live[sess.id] = sess
- req.oncommit(self.addcookie)
+ sess.new = True
req.oncommit(self.ckfreeze)
return sess
req.oncommit(self.ckfreeze)
return sess
- def addcookie(self, req):
- sess = req.item(self.fetch)
- cookie.add(req, self.cookiename, sess.id, self.path)
-
def ckfreeze(self, req):
sess = req.item(self.fetch)
if sess.dirty():
try:
def ckfreeze(self, req):
sess = req.item(self.fetch)
if sess.dirty():
try:
+ if getattr(sess, "new", False):
+ cookie.add(req, self.cookiename, sess.id, self.path)
+ del sess.new
self.freeze(sess)
except:
pass
self.freeze(sess)
except:
pass