From: Guido van Rossum Date: Fri, 4 Sep 1998 21:19:55 +0000 (+0000) Subject: Use SCRIPT_NAME (if defined) instead of hardcoding /cgi-bin/ when X-Git-Tag: v1.5.2a2~322 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2053aa6cc05a3aa581db083138b0ed94f60ec920;p=python Use SCRIPT_NAME (if defined) instead of hardcoding /cgi-bin/ when sending the cookie. (Suggestion by AMK.) --- diff --git a/Tools/faqwiz/faqwiz.py b/Tools/faqwiz/faqwiz.py index 618b62d235..2add159005 100644 --- a/Tools/faqwiz/faqwiz.py +++ b/Tools/faqwiz/faqwiz.py @@ -150,7 +150,8 @@ def send_my_cookie(ui): value = urllib.quote(value) then = now + COOKIE_LIFETIME 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) class MagicDict: