Prakash’s Blog

Innovation Explored

Prakash’s Blog header image 2

How to write a Cookie

June 16th, 2004 · No Comments

Open a Python Script and add this

now = DateTime()
e = DateTime(now.year()+1, now.month(), now.day())
#set the cookie
RESPONSE.setCookie(name=’test_cookie’, value=100, path=’/', expires=e.rfc822())

and read the cookie value

if request.cookies.has_key(’test_cookie’):
the_value = getattr(request, ‘test_cookie’)

print the_value

return printed

Tags: Other

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment