class documentation

class CookieStorage(BaseStorage):

View In Hierarchy

Store messages in a cookie.
Method __init__ Undocumented
Method ​_decode Safely decode an encoded text stream back into a list of messages.
Method ​_encode Return an encoded version of the messages list which can be stored as plain text.
Method ​_get No summary
Method ​_store Store the messages to a cookie and return a list of any messages which could not be stored.
Method ​_update​_cookie Either set the cookie with the encoded data if there is any data to store, or delete the cookie.
Class Variable cookie​_name Undocumented
Class Variable key​_salt Undocumented
Class Variable max​_cookie​_size Undocumented
Class Variable not​_finished Undocumented
Instance Variable signer Undocumented
Instance Variable used Undocumented

Inherited from BaseStorage:

Method __contains__ Undocumented
Method __iter__ Undocumented
Method __len__ Undocumented
Method __repr__ Undocumented
Method ​_get​_level Return the minimum recorded level.
Method ​_prepare​_messages Prepare a list of messages for storage.
Method ​_set​_level Set a custom minimum recorded level.
Method add Queue a message to be stored.
Method update Store all unread messages.
Class Variable level Undocumented
Instance Variable ​_level Undocumented
Instance Variable ​_queued​_messages Undocumented
Instance Variable added​_new Undocumented
Instance Variable request Undocumented
Property ​_loaded​_messages Return a list of loaded messages, retrieving them first if they have not been loaded yet.
def __init__(self, *args, **kwargs):
def _decode(self, data):

Safely decode an encoded text stream back into a list of messages.

If the encoded text stream contained an invalid hash or was in an invalid format, return None.

def _encode(self, messages, encode_empty=False):

Return an encoded version of the messages list which can be stored as plain text.

Since the data will be retrieved from the client-side, the encoded data also contains a hash to ensure that the data was not tampered with.

def _get(self, *args, **kwargs):
Retrieve a list of messages from the messages cookie. If the not_finished sentinel value is found at the end of the message list, remove it and return a result indicating that not all messages were retrieved by this storage.
def _store(self, messages, response, remove_oldest=True, *args, **kwargs):

Store the messages to a cookie and return a list of any messages which could not be stored.

If the encoded data is larger than max_cookie_size, remove messages until the data fits (these are the messages which are returned), and add the not_finished sentinel value to indicate as much.

def _update_cookie(self, encoded_data, response):
Either set the cookie with the encoded data if there is any data to store, or delete the cookie.
cookie_name: str =

Undocumented

key_salt: str =

Undocumented

max_cookie_size: int =

Undocumented

not_finished: str =

Undocumented

signer =

Undocumented