Problem reading HTTP_COOKIE

Jack Hatterly jackhatterly at
Fri Aug 12 11:55:33 EDT 2011


I'm trying to get cookies to work and I've traced my problem down to this reduced script:

#! /usr/bin/python

import string

import os

import datetime, Cookie, random

import time

import os

def parse_cookie():

  print 'Content-Type: text/html\n'

  print os.environ.get('HTTP_COOKIE')

  print '<html><body>'

  print '</body></html>'

if __name__ == "__main__":


It prints "None". However, when I look in my browser's cookie jar, there
 is a cookie "" where my_site is the site from which I am
 surfing the above script. What gives?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list