Navigation

  • index
  • next |
  • previous |
  • Python Fat Cookie Library v1.0_pre documentation »

Fat Cookie API¶

Classes Provided by Python Fat Cookie¶

class pycookie.FatCookie(cookie, check_sig=True, check_expire=True)¶

Decoded Fat Cookie object.

This class handles decoding and verification of the EID Fat Cookie. You just need to pass it the encoded data from the FC cookie. If there is an error an FatCookieException will be raised and the class will not decode the cookie. You can check on the errors or skip the verification of the cookie by setting check_sig and/or check_expire:

test_user = FatCookie(request.COOKIES['FC'], check_sig=False, check_expire=False)

Class Attributes:

You can access these attributes simply by creating a new FatCookie object then calling the property:

user = FatCookie(request.COOKIES['FC'])
user.eid == "eid stored in cookie 'FC'"
is_valid¶
Boolean indicating whether the Fat Cookie signature is valid. This Raises FatCookieException if the value is False unless debug is set to True.
version¶
The version of the fat cookie library used by mod_auth_eid.
uin¶
The UIN stored in the Fat Cookie.
eid¶
The EID stored in the Fat Cookie.
expiration¶
Python datatime.datetime object for the time the cookie expires. This Raises FatCookieException if the cookie is expired unless debug is set to True.
ipaddr¶
IP Address that the user authenticated from stored in the fat cookie.
assurance¶
Boolean indicating whether the EID a high assurance EID or not.
roles¶
A list of pycookie.helpers.Role Class objects that are tied to the users cookie.
expired()¶
Returns True or False indicating the time encoded in the cookie has expired.
print_debug()¶
Prints out information from the cookie, useful for debuging.

Utility functions¶

pycookie.get_version()¶
Returns the Python Fat Cookie Library version as a human-format string.

Table Of Contents

  • Fat Cookie API
    • Classes Provided by Python Fat Cookie
    • Utility functions

Previous topic

Getting Started with the Python Fat Cookie Library

Next topic

Developer Documentation AKA ‘Hacking’ the Library

This Page

  • Show Source

Quick search

Navigation

  • index
  • next |
  • previous |
  • Python Fat Cookie Library v1.0_pre documentation »
© Copyright 2008, Robert Myers. Last updated on Mar 25, 2009. Created using Sphinx 0.5.1.