Trying to set a cookie within a python script
nikos.the.gr33k at gmail.com
Mon Aug 2 14:32:49 CEST 2010
First of all thank you for your response. I cant beleive i neglected
to import the time module!
The only reason that i asked you guys to follow the link was for you
to see the actualt coding and error report as python produces it by
itself with all the relative characteristics. Of course it was not due
to boredom and there was no need to be aggresive with me as this
wasn't the case. I thouigh that by giving the URL was easier for you
Now the script runs but for some reason only the code block within the
'else' tun each time:
print "ΑΠΟ ΔΩ ΚΑΙ ΣΤΟ ΕΞΗΣ ΔΕΝ ΣΕ ΕΙΔΑ, ΔΕΝ ΣΕ ΞΕΡΩ, ΔΕΝ ΣΕ ΑΚΟΥΣΑ!
ΘΑ ΕΙΣΑΙ ΠΛΕΟΝ Ο ΑΟΡΑΤΟΣ ΕΠΙΣΚΕΠΤΗΣ!!"
cookie['visitor'] = ( 'nikos', time() + 60*60*24*365 ) #this cookie
will expire in an year
The cookie is only get set and never expires
i changed the if with this
if os.environ.get('HTTP_COOKIE') and cookie.has_key('visitor') ==
'nikos': #if visitor cookie exist
but still no luck.
As for the encoding Notepad++, which is what i use for an editor say
its UTF-8 without BOM.
Isn't this what i'm supposed to use?
My Python scripts only containes english and greek letters, so i
though usign UTF-8 is the way to go. No?! Please if you explain to me
in greater detail!
More information about the Python-list