Skip to content

Commit 6ae75d0

Browse files
author
Richard Jones
committed
call the cookie something else since it changed
1 parent 11645d3 commit 6ae75d0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

roundup/cgi/client.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.7 2002-09-03 02:58:11 richard Exp $
1+
# $Id: client.py,v 1.8 2002-09-03 03:23:56 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -155,11 +155,12 @@ def determine_user(self):
155155
cookie = Cookie.Cookie(self.env.get('HTTP_COOKIE', ''))
156156
user = 'anonymous'
157157

158-
if (cookie.has_key('roundup_user') and
159-
cookie['roundup_user'].value != 'deleted'):
158+
# bump the "revision" of the cookie since the format changed
159+
if (cookie.has_key('roundup_user_2') and
160+
cookie['roundup_user_2'].value != 'deleted'):
160161

161162
# get the session key from the cookie
162-
self.session = cookie['roundup_user'].value
163+
self.session = cookie['roundup_user_2'].value
163164
# get the user from the session
164165
try:
165166
# update the lifetime datestamp
@@ -385,7 +386,7 @@ def set_cookie(self, user, password):
385386
# generate the cookie path - make sure it has a trailing '/'
386387
path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'],
387388
''))
388-
self.header({'Set-Cookie': 'roundup_user=%s; expires=%s; Path=%s;'%(
389+
self.header({'Set-Cookie': 'roundup_user_2=%s; expires=%s; Path=%s;'%(
389390
self.session, expire, path)})
390391

391392
def make_user_anonymous(self):
@@ -407,7 +408,7 @@ def logout(self):
407408
path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'],
408409
''))
409410
self.header({'Set-Cookie':
410-
'roundup_user=deleted; Max-Age=0; expires=%s; Path=%s;'%(now,
411+
'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now,
411412
path)})
412413
self.login()
413414

@@ -466,7 +467,7 @@ def logout_action(self):
466467
path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'],
467468
''))
468469
self.header(headers={'Set-Cookie':
469-
'roundup_user=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)})
470+
'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)})
470471

471472
# Let the user know what's going on
472473
self.ok_message.append(_('You are logged out'))

0 commit comments

Comments
 (0)