Plack::Middleware::Session::Cookie(3pm)

Plack::Middleware::Session::Cookie3pm

Session middleware that saves session data in the cookie

Usage

  enable 'Session::Cookie',
    session_key => 'my_session',
    expires     => 3600, # 1 hour
    secret      => 'top-secret'
    ;

Overview

This middleware component allows you to use the cookie as a sole cookie state and store, without any server side storage to do the session management. This middleware utilizes its own state and store automatically for you, so you can't override the objects.

Configurations

This middleware is a subclass of Plack::Middleware::Session and accepts most configuration of the parent class. In addition, following options are accepted.

secret

Server side secret to sign the session data using HMAC SHA1. Defaults to nothing (i.e. do not sign) but strongly recommended to set your own secret string.

Unless you use your own serializer/deserializer, running this middleware without setting a secret is vulnerable to arbitrary code execution. In the future release it will be required to set the secret.

session_key, domain, expires, path, secure, httponly, samesite

Accessors for the cookie attributes. See Plack::Session::State::Cookie for these options.

Releases

7 releases since Debian 7 (Wheezy); the text changed 6 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13

Author

Tatsuhiko Miyagawa

From libplack-middleware-session-perl 0.34-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.