Skip to content

Commit 3b87b93

Browse files
committed
Fix #1792: Lowercase all cookie keys, actually allow overriding the samesite value
1 parent 3e6e1df commit 3b87b93

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

debug_toolbar/static/debug_toolbar/js/toolbar.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ const djdt = {
341341
options.path ? "; path=" + options.path : "",
342342
options.domain ? "; domain=" + options.domain : "",
343343
options.secure ? "; secure" : "",
344-
"sameSite" in options
345-
? "; sameSite=" + options.samesite
346-
: "; sameSite=Lax",
344+
"samesite" in options
345+
? "; samesite=" + options.samesite
346+
: "; samesite=lax",
347347
].join("");
348348

349349
return value;

docs/changes.rst

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Pending
77
* Adjusted app directories system check to allow for nested template loaders.
88
* Switched from flake8, isort and pyupgrade to `ruff
99
<https://beta.ruff.rs/>`__.
10+
* Converted cookie keys to lowercase. Fixed the ``samesite`` argument to
11+
``djdt.cookie.set``.
1012

1113
4.1.0 (2023-05-15)
1214
------------------

docs/panels.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,9 @@ common methods available.
421421
:param value: The value to be set.
422422

423423
:param options: The options for the value to be set. It should contain the
424-
properties ``expires`` and ``path``.
424+
properties ``expires`` and ``path``. The properties ``domain``,
425+
``secure`` and ``samesite`` are also supported. ``samesite`` defaults
426+
to ``lax`` if not provided.
425427

426428
.. js:function:: djdt.hide_toolbar
427429

0 commit comments

Comments
 (0)