|
1 | | -# $Id: client.py,v 1.65.2.3 2003-02-06 05:44:49 richard Exp $ |
| 1 | +# $Id: client.py,v 1.65.2.4 2003-02-08 23:03:36 richard Exp $ |
2 | 2 |
|
3 | 3 | __doc__ = """ |
4 | 4 | WWW request handler (also used in the stand-alone server). |
@@ -95,6 +95,8 @@ def __init__(self, instance, request, env, form=None): |
95 | 95 | # this is the "cookie path" for this tracker (ie. the path part of |
96 | 96 | # the "base" url) |
97 | 97 | self.cookie_path = urlparse.urlparse(self.base)[2] |
| 98 | + self.cookie_name = 'roundup_session_' + re.sub('[^a-zA-Z]', '', |
| 99 | + self.instance.config.TRACKER_NAME) |
98 | 100 |
|
99 | 101 | # see if we need to re-parse the environment for the form (eg Zope) |
100 | 102 | if form is None: |
@@ -217,11 +219,11 @@ def determine_user(self): |
217 | 219 | user = 'anonymous' |
218 | 220 |
|
219 | 221 | # bump the "revision" of the cookie since the format changed |
220 | | - if (cookie.has_key('roundup_user_2') and |
221 | | - cookie['roundup_user_2'].value != 'deleted'): |
| 222 | + if (cookie.has_key(self.cookie_name) and |
| 223 | + cookie[self.cookie_name].value != 'deleted'): |
222 | 224 |
|
223 | 225 | # get the session key from the cookie |
224 | | - self.session = cookie['roundup_user_2'].value |
| 226 | + self.session = cookie[self.cookie_name].value |
225 | 227 | # get the user from the session |
226 | 228 | try: |
227 | 229 | # update the lifetime datestamp |
@@ -475,8 +477,8 @@ def set_cookie(self, user): |
475 | 477 |
|
476 | 478 | # generate the cookie path - make sure it has a trailing '/' |
477 | 479 | self.additional_headers['Set-Cookie'] = \ |
478 | | - 'roundup_user_2=%s; expires=%s; Path=%s;'%(self.session, expire, |
479 | | - self.cookie_path) |
| 480 | + '%s=%s; expires=%s; Path=%s;'%(self.cookie_name, self.session, |
| 481 | + expire, self.cookie_path) |
480 | 482 |
|
481 | 483 | def make_user_anonymous(self): |
482 | 484 | ''' Make us anonymous |
@@ -572,8 +574,8 @@ def logout_action(self): |
572 | 574 | # construct the logout cookie |
573 | 575 | now = Cookie._getdate() |
574 | 576 | self.additional_headers['Set-Cookie'] = \ |
575 | | - 'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, |
576 | | - self.cookie_path) |
| 577 | + '%s=deleted; Max-Age=0; expires=%s; Path=%s;'%(self.cookie_name, |
| 578 | + now, self.cookie_path) |
577 | 579 |
|
578 | 580 | # Let the user know what's going on |
579 | 581 | self.ok_message.append(_('You are logged out')) |
|
0 commit comments