cookies.py |
|
---|---|
A middleware that adds cookie support. |
|
Adds a "cookies" key to the request, which contains a dictionary containing any cookies sent by the client. If any new values are found in the dictionary after your app is called, the new cookies are sent to the client. The values in the dict will be converted to strings, unless they are themselves dicts. In that case, the "value" key will be used as the cookie value and the other keys will be interpreted as cookie attributes.
Note: if a cookie is set and is later deleted from request["cookies"], the corresponding cookie will not automatically be deleted. You need to set the "expires" attribute of the cookie to a time in the past. |
|
|
|
Get any cookies from the request. |
|
If the app modified request["cookies"], set the new cookies. |
|
Parse the cookies from a request into a dictionary. |
|
Formats the dict of cookies for the set_cookie header. If a value is a dict, its "value" key will be used as the value and the other keys will be interpreted as cookie attributes. |
|