|
1 | | -# $Id: client.py,v 1.72 2003-01-20 23:05:19 richard Exp $ |
| 1 | +# $Id: client.py,v 1.73 2003-01-24 06:21:17 richard Exp $ |
2 | 2 |
|
3 | 3 | __doc__ = """ |
4 | 4 | WWW request handler (also used in the stand-alone server). |
@@ -89,9 +89,13 @@ def __init__(self, instance, request, env, form=None): |
89 | 89 | # save off the path |
90 | 90 | self.path = env['PATH_INFO'] |
91 | 91 |
|
92 | | - # this is the base URL for this instance |
| 92 | + # this is the base URL for this tracker |
93 | 93 | self.base = self.instance.config.TRACKER_WEB |
94 | 94 |
|
| 95 | + # this is the "cookie path" for this tracker (ie. the path part of |
| 96 | + # the "base" url) |
| 97 | + self.cookie_path = urlparse.urlparse(self.base)[2] |
| 98 | + |
95 | 99 | # see if we need to re-parse the environment for the form (eg Zope) |
96 | 100 | if form is None: |
97 | 101 | self.form = cgi.FieldStorage(environ=env) |
@@ -480,10 +484,9 @@ def set_cookie(self, user): |
480 | 484 | expire = Cookie._getdate(86400*365) |
481 | 485 |
|
482 | 486 | # generate the cookie path - make sure it has a trailing '/' |
483 | | - path = '/'.join((self.env['SCRIPT_NAME'], self.env['TRACKER_NAME'], |
484 | | - '')) |
485 | 487 | self.additional_headers['Set-Cookie'] = \ |
486 | | - 'roundup_user_2=%s; expires=%s; Path=%s;'%(self.session, expire, path) |
| 488 | + 'roundup_user_2=%s; expires=%s; Path=%s;'%(self.session, expire, |
| 489 | + self.cookie_path) |
487 | 490 |
|
488 | 491 | def make_user_anonymous(self): |
489 | 492 | ''' Make us anonymous |
@@ -578,10 +581,9 @@ def logout_action(self): |
578 | 581 |
|
579 | 582 | # construct the logout cookie |
580 | 583 | now = Cookie._getdate() |
581 | | - path = '/'.join((self.env['SCRIPT_NAME'], self.env['TRACKER_NAME'], |
582 | | - '')) |
583 | 584 | self.additional_headers['Set-Cookie'] = \ |
584 | | - 'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path) |
| 585 | + 'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, |
| 586 | + self.cookie_path) |
585 | 587 |
|
586 | 588 | # Let the user know what's going on |
587 | 589 | self.ok_message.append(_('You are logged out')) |
|
0 commit comments