summaryrefslogtreecommitdiff
path: root/paste/auth
diff options
context:
space:
mode:
authorianb <devnull@localhost>2008-03-08 21:50:15 +0000
committerianb <devnull@localhost>2008-03-08 21:50:15 +0000
commit76be018175929b69da33992804c86c4f5495abf1 (patch)
tree660e327fb64a90fd28936fcbe525de2af7776bd6 /paste/auth
parentca27faa249268980f7fcc54a7be08bb0b43c7658 (diff)
downloadpaste-76be018175929b69da33992804c86c4f5495abf1.tar.gz
Set same cookies with same domains on logout as you do on login, in auth_tkt
Diffstat (limited to 'paste/auth')
-rw-r--r--paste/auth/auth_tkt.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/paste/auth/auth_tkt.py b/paste/auth/auth_tkt.py
index c35c379..b1531f2 100644
--- a/paste/auth/auth_tkt.py
+++ b/paste/auth/auth_tkt.py
@@ -299,9 +299,16 @@ class AuthTKTMiddleware(object):
secure=self.secure)
# @@: Should we set REMOTE_USER etc in the current
# environment right now as well?
+ cur_domain = environ.get('HTTP_HOST', environ.get('SERVER_NAME'))
+ wild_domain = '.' + cur_domain
cookies = [
('Set-Cookie', '%s=%s; Path=/' % (
- self.cookie_name, ticket.cookie_value()))]
+ self.cookie_name, ticket.cookie_value())),
+ ('Set-Cookie', '%s=%s; Path=/; Domain=%s' % (
+ self.cookie_name, ticket.cookie_value(), cur_domain)),
+ ('Set-Cookie', '%s=%s; Path=/; Domain=%s' % (
+ self.cookie_name, ticket.cookie_value(), wild_domain))
+ ]
return cookies
def logout_user_cookie(self, environ):