@@ -18,16 +18,17 @@ cookie value.
18
18
19
19
The module formerly strictly applied the parsing rules described in the
20
20
:rfc: `2109 ` and :rfc: `2068 ` specifications. It has since been discovered that
21
- MSIE 3.0x doesn't follow the character rules outlined in those specs and also
22
- many current day browsers and servers have relaxed parsing rules when comes to
23
- Cookie handling. As a result, the parsing rules used are a bit less strict.
21
+ MSIE 3.0x didn't follow the character rules outlined in those specs; many
22
+ current-day browsers and servers have also relaxed parsing rules when it comes
23
+ to cookie handling. As a result, this module now uses parsing rules that are a
24
+ bit less strict than they once were.
24
25
25
26
The character set, :data: `string.ascii_letters `, :data: `string.digits ` and
26
27
``!#$%&'*+-.^_`|~: `` denote the set of valid characters allowed by this module
27
- in Cookie name (as :attr: `~Morsel.key `).
28
+ in a cookie name (as :attr: `~Morsel.key `).
28
29
29
30
.. versionchanged :: 3.3
30
- Allowed ':' as a valid Cookie name character.
31
+ Allowed ':' as a valid cookie name character.
31
32
32
33
33
34
.. note ::
@@ -54,9 +55,10 @@ in Cookie name (as :attr:`~Morsel.key`).
54
55
55
56
.. class :: SimpleCookie([input])
56
57
57
- This class derives from :class: `BaseCookie ` and overrides :meth: `value_decode `
58
- and :meth: `value_encode `. SimpleCookie supports strings as cookie values.
59
- When setting the value, SimpleCookie calls the builtin :func: `str() ` to convert
58
+ This class derives from :class: `BaseCookie ` and overrides :meth: `~BaseCookie.value_decode `
59
+ and :meth: `~BaseCookie.value_encode `. :class: `!SimpleCookie ` supports
60
+ strings as cookie values. When setting the value, :class: `!SimpleCookie `
61
+ calls the builtin :func: `str ` to convert
60
62
the value to a string. Values received from HTTP are kept as strings.
61
63
62
64
.. seealso ::
@@ -129,17 +131,17 @@ Morsel Objects
129
131
Abstract a key/value pair, which has some :rfc: `2109 ` attributes.
130
132
131
133
Morsels are dictionary-like objects, whose set of keys is constant --- the valid
132
- :rfc: `2109 ` attributes, which are
133
-
134
- * `` expires ``
135
- * `` path ``
136
- * `` comment ``
137
- * `` domain ``
138
- * `` max-age ``
139
- * `` secure ``
140
- * `` version ``
141
- * `` httponly ``
142
- * `` samesite ``
134
+ :rfc: `2109 ` attributes, which are:
135
+
136
+ .. attribute :: expires
137
+ path
138
+ comment
139
+ domain
140
+ max-age
141
+ secure
142
+ version
143
+ httponly
144
+ samesite
143
145
144
146
The attribute :attr: `httponly ` specifies that the cookie is only transferred
145
147
in HTTP requests, and is not accessible through JavaScript. This is intended
@@ -152,7 +154,7 @@ Morsel Objects
152
154
The keys are case-insensitive and their default value is ``'' ``.
153
155
154
156
.. versionchanged :: 3.5
155
- :meth: `~Morsel. __eq__ ` now takes :attr: `~Morsel.key ` and :attr: `~Morsel.value `
157
+ :meth: `! __eq__ ` now takes :attr: `~Morsel.key ` and :attr: `~Morsel.value `
156
158
into account.
157
159
158
160
.. versionchanged :: 3.7
0 commit comments