mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
ds_author cookie can now expire, closes #829
Refs https://github.com/simonw/datasette-auth-github/issues/62#issuecomment-642152076
This commit is contained in:
parent
d828abadde
commit
57e812d5de
9 changed files with 99 additions and 21 deletions
|
|
@ -153,12 +153,12 @@ To set cookies on the response, use the ``response.set_cookie(...)`` method. The
|
|||
samesite="lax",
|
||||
):
|
||||
|
||||
You can use this with :ref:`datasette.sign() <datasette_sign>` to set signed cookies. Here's how you would set the ``ds_actor`` cookie for use with Datasette :ref:`authentication <authentication>`:
|
||||
You can use this with :ref:`datasette.sign() <datasette_sign>` to set signed cookies. Here's how you would set the :ref:`ds_actor cookie <authentication_ds_actor>` for use with Datasette :ref:`authentication <authentication>`:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
response = Response.redirect("/")
|
||||
response.set_cookie("ds_actor", datasette.sign({"id": "cleopaws"}, "actor"))
|
||||
response.set_cookie("ds_actor", datasette.sign({"a": {"id": "cleopaws"}}, "actor"))
|
||||
return response
|
||||
|
||||
.. _internals_datasette:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue