I am new in python cgi script. I want to read cookie in python. I tried following code:
from urllib2 import Request, build_opener, HTTPCookieProcessor, HTTPHandler
import cookielib
#Create a CookieJar object to hold the cookies
cj = cookielib.CookieJar()
#Create an opener to open pages using the http protocol and to process cookies.
opener = build_opener(HTTPCookieProcessor(cj), HTTPHandler())
#Check out the cookies
print "the cookies are: "
for cookie in cj:
print cookie
But, I see only the cookies are:
msg.
Am I doing something wrong?