mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
Use SCRIPT_NAME (if defined) instead of hardcoding /cgi-bin/ when
sending the cookie. (Suggestion by AMK.)
This commit is contained in:
parent
a74d0e4c55
commit
2053aa6cc0
1 changed files with 2 additions and 1 deletions
|
@ -150,7 +150,8 @@ def send_my_cookie(ui):
|
||||||
value = urllib.quote(value)
|
value = urllib.quote(value)
|
||||||
then = now + COOKIE_LIFETIME
|
then = now + COOKIE_LIFETIME
|
||||||
gmt = time.gmtime(then)
|
gmt = time.gmtime(then)
|
||||||
print "Set-Cookie: %s=%s; path=/cgi-bin/;" % (name, value),
|
path = os.environ.get('SCRIPT_NAME', '/cgi-bin/')
|
||||||
|
print "Set-Cookie: %s=%s; path=%s;" % (name, value, path),
|
||||||
print time.strftime("expires=%a, %d-%b-%y %X GMT", gmt)
|
print time.strftime("expires=%a, %d-%b-%y %X GMT", gmt)
|
||||||
|
|
||||||
class MagicDict:
|
class MagicDict:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue