euphorie.client.cookie

euphorie.client.cookie.setCookie(response, secret, name, value, timeout=0)

Set a secure HTTP cookie. The cookie will be signed using secret. An expiration time for the cookie will be set if timeout is specified.

Parameters:
  • response (ZPublisher.HTTPResponse.HTTPResponse) – HTTP response object
  • secret (str) – authentication secret used to sign the cookie
  • name (str) – name of the cookie to set.
  • value (str) – value of the cookie
  • timeout (int) – maximum lifetime of the cookie (in seconds)
euphorie.client.cookie.getCookie(request, secret, name)

Get a potentially secure HTTP cookie. This method decodes a cookie and returns a tuple with its signature and data. If no cookie is found or the cookie has an invalid signature None is returned instead.

Parameters:
  • request (ZPublisher.HTTPRequest.HTTPHTTPRequest) – HTTP request object
  • secret (str) – authentication secret used to sign the cookie
  • name (str) – name of the cookie to get.
euphorie.client.cookie.deleteCookie(response, name)

Remove an existing cookie.

Parameters:
  • response (ZPublisher.HTTPResponse.HTTPResponse) – HTTP response object
  • name (str) – name of the cookie to delete.

Previous topic

euphorie.client.client

Next topic

euphorie.client.model

This Page