Problem checking an existing browser cookie

Νίκος nikos.the.gr33k at gmail.com
Mon Aug 16 06:57:58 EDT 2010


# initialize cookie
cookie = Cookie.SimpleCookie()
cookie.load( os.environ.get('HTTP_COOKIE', '') )
mycookie = cookie.get('visitor')

if ( mycookie and mycookie.value != 'nikos' ) or re.search( r'(cyta|
yandex|13448|spider|crawl)', host ) is None:
    blabla...
========================

I checked and Chrome has a cookie names visitor with a value of nikos
within.
So, i have to ask why the if fails?

Thank you.



More information about the Python-list mailing list