SessionMiddleware class provides session management using signed cookies. It allows you to store user-specific data across requests securely.
Parameters
Secret key used to sign session cookies. This should be a long, random string kept secure and never committed to version control.
Name of the session cookie stored in the browser.
Session lifetime in seconds. Default is 1,209,600 seconds (14 days). Set to
None for a session cookie that expires when the browser closes.Cookie path. Restricts the cookie to a specific path on your domain.
SameSite cookie attribute. Can be
"strict", "lax", or "none". Controls whether cookies are sent with cross-site requests.Whether to set the Secure flag on the cookie, restricting it to HTTPS connections only. Should be
True in production.Cookie domain. Allows sharing cookies across subdomains when set.