Plack::Session(3pm)

Plack::Session3pm

Middleware for session management

Usage

  # Use with Middleware::Session
  enable "Session";
  # later in your app
  use Plack::Session;
  my $app = sub {
      my $env = shift;
      my $session = Plack::Session->new($env);
      $session->id;
      $session->get($key);
      $session->set($key, $value);
      $session->remove($key);
      $session->keys;
      $session->expire;
  };

Overview

This is the core session object, you probably want to look at Plack::Middleware::Session, unless you are writing your own session middleware component.

Methods

new ( $env )

The constructor takes a PSGI request env hash reference.

id

This is the accessor for the session id.

Session Data Management

These methods allows you to read and write the session data like Perl's normal hash.

get ( $key )
set ( $key, $value )
remove ( $key )
keys
session, dump

Session Lifecycle Management

expire

This method can be called to expire the current session id.

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

Bugs

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

Author

Stevan Little <[email protected]>

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