{"database": "docs", "table": "sections", "rows": [["authentication:authentication-ds-actor-expiry", "authentication", "authentication-ds-actor-expiry", "Including an expiry time", "ds_actor  cookies can optionally include a signed expiry timestamp, after which the cookies will no longer be valid. Authentication plugins may chose to use this mechanism to limit the lifetime of the cookie. For example, if a plugin implements single-sign-on against another source it may decide to set short-lived cookies so that if the user is removed from the SSO system their existing Datasette cookies will stop working shortly afterwards. \n                 To include an expiry, add a  \"e\"  key to the cookie value containing a base62-encoded integer representing the timestamp when the cookie should expire. For example, here's how to set a cookie that expires after 24 hours: \n                 import time\nfrom datasette.utils import baseconv\n\nexpires_at = int(time.time()) + (24 * 60 * 60)\n\nresponse = Response.redirect(\"/\")\nresponse.set_cookie(\n    \"ds_actor\",\n    datasette.sign(\n        {\n            \"a\": {\"id\": \"cleopaws\"},\n            \"e\": baseconv.base62.encode(expires_at),\n        },\n        \"actor\",\n    ),\n) \n                 The resulting cookie will encode data that looks something like this: \n                 {\n    \"a\": {\n        \"id\": \"cleopaws\"\n    },\n    \"e\": \"1jjSji\"\n}", "[\"Authentication and permissions\", \"The ds_actor cookie\"]", "[]"]], "columns": ["id", "page", "ref", "title", "content", "breadcrumbs", "references"], "primary_keys": ["id"], "primary_key_values": ["authentication:authentication-ds-actor-expiry"], "units": {}, "query_ms": 2.00972001766786}