March 27th, 2005, 06:39 PM
I got error while reading it using python
Help me out
My code : for python cookies
from Cookie import *
from os import *
from cgi import *
C:\Python23\lib\Cookie.py:712: DeprecationWarning: Cookie/SmartCookie class is insecure; do not use it
Traceback (most recent call last):
File "C:\Documents and Settings\Arpan Shah\Desktop\dem.py", line 8, in -toplevel-
File "C:\Python23\lib\os.py", line 417, in __getitem__
Please let me know , why i am getting this error,
I dont have any environment variable set as HTTP_Cookie
i am juss running a sample python code to read all cookie data.
Any help will be appreicated.
April 26th, 2005, 11:26 PM
Exactly as you said, you don't have the environment variable set.
You probably want this code to read something like:
April 27th, 2005, 04:29 AM
Some debugging hints:
- check if the cookie is set in your browser
If you have the cookie set in your browser and you still don't get the cookie, there may be a problem with your web server.
<!-- begin hiding
document.cookie = "hello=world;"
// end hiding -->
April 27th, 2005, 02:28 PM
The question should be resolved already, but I have to have my say .
As Orr1and sbkwi have said, the problem has to do with the HTTP_COOKIE header not being available, so it can't be parsed. This is probably because of the way you're running it. It looks to me as if the program is either being run either from the command line or in the interpreter?
You might also be interested in the cookies.py file in my Net module. Though it doesn't actually use the Cookie module I should give you a better understanding of whats going on .
Take care all,