Zope Python Script Set, retrieve and remove cookies


#set a cookie and expire after 30 days
context.REQUEST.RESPONSE.setCookie('cookiename', 'the value',  path = '/', max_age = 30 * 24 * 3600)
#get the cookie value
theVal = context.REQUEST['cookiename']
#remove the cookie
context.REQUEST.RESPONSE.setCookie('cookiename', None,  path = '/', max_age = 0)
Posted by
Snippet Viewed 3091 times.

Share your Zope Python Script code snippets:

  • Get some recognition & a link back to your site.
  • Create your own code library.
  • Help your fellow developers, as they have helped you.

 

Submit | Browse

Most Recent zope python snippets

Most Viewed