|
Padmashree B
paddu12 at gmail.com
Fri Sep 22 10:08:08 EDT 2006
Hi.. i am trying to figure out cgi code written using Python..
I create a cookie using
import Cookie
c=Cookie.SimpleCookie()
c["cookie1"]="value1"
Now when I want to retrive the cookie value in CGI written using python do I
necessary have to depend on the environment variable HTTP_COOKIE which is
set in os.environ..
as in
thiscookie = Cookie.SimpleCookie()
if os.environ.has_key('HTTP_COOKIE'):
thiscookie.load(os.environ['HTTP_COOKIE'])
print thiscookie['aparam'].value
Is there any other way to do without using the variable HTTP_COOKIE set in
os.environ..
Also, is it ok to use this code in mod_python.. as in getting the cookie
values using the environment variable HTTP_COOKIE...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20060922/0e06f782/attachment.html
|