Module Cookie :: Class SerialCookie
[hide private]
[frames] | no frames]

type SerialCookie

object --+        
         |        
      dict --+    
             |    
    BaseCookie --+
                 |
                SerialCookie

SerialCookie SerialCookie supports arbitrary objects as cookie values. All values are serialized (using cPickle) before being sent to the client. All incoming values are assumed to be valid Pickle representations. IF AN INCOMING VALUE IS NOT IN A VALID PICKLE FORMAT, THEN AN EXCEPTION WILL BE RAISED.

Note: Large cookie values add overhead because they must be retransmitted on every HTTP transaction.

Note: HTTP has a 2k limit on the size of a cookie. This class does not check for this limit, so be careful!!!

Instance Methods [hide private]
new empty dictionary

__init__(self, input=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
value_decode(self, val)
real_value, coded_value = value_decode(STRING) Called prior to setting a cookie's value from the network representation.
 
value_encode(self, val)
real_value, coded_value = value_encode(VALUE) Called prior to setting a cookie's value from the dictionary representation.

Inherited from BaseCookie: __repr__, __setitem__, __str__, js_output, load, output

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __ne__, __new__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Method Details [hide private]

__init__(self, input=None)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns:
new empty dictionary

Overrides: dict.__init__
(inherited documentation)

value_decode(self, val)

 

real_value, coded_value = value_decode(STRING) Called prior to setting a cookie's value from the network representation. The VALUE is the value read from HTTP header. Override this function to modify the behavior of cookies.

Overrides: BaseCookie.value_decode
(inherited documentation)

value_encode(self, val)

 

real_value, coded_value = value_encode(VALUE) Called prior to setting a cookie's value from the dictionary representation. The VALUE is the value being assigned. Override this function to modify the behavior of cookies.

Overrides: BaseCookie.value_encode
(inherited documentation)