Plack::Session(3pm)
π Plack::Session π
ok so bestie, you found the manual page for Plack::Session, which is a User Contributed Perl Documentation page in section 3pm (that's Perl module docs, iykyk). Let's get into it, no cap.
β¨ NAME β¨
Plack::Session β Middleware for session management π
π¦ SYNOPSIS π¦
like, here's the whole vibe in code form:
# 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;
};
periodt. that's the whole flow π
πΈ DESCRIPTION πΈ
okay so here's the tea β β Plack::Session is the core session object. That's its whole job. If you're just out here living your life and wanting sessions to work, you probably want to go look at Plack::Middleware::Session instead, bestie. This one is for the people writing their own session middleware component. main character energy, but for middleware devs π
π METHODS π
new ( $env )
The constructor. It takes a PSGI request env hash reference and gives you back your session object. that's it, that's the whole thing π
id
This is the accessor for the session id. literally just hands you the id. iconic.
π Session Data Management π
These methods let you read and write your session data the same way you'd poke at Perl's normal hash. same energy, different object πͺ
get ( $key )set ( $key, $value )remove ( $key )keyssession,dump
no cap, that's all the page tells you about each of these β the names, the args, and the whole "works like a hash" vibe. if you need more, that's a you-and-the-source-code situation π
π§ Session Lifecycle Management π§
expireβ you call this when you want to expire the current session id. That's the move. bye-bye session π«‘
π BUGS π
ngl, all complex software has bugs lurking in it, and this module is not the exception β it's in the club too π. So if you find a bug, please either email me, or add the bug to cpan-RT. we appreciate you fr fr π«Ά
π AUTHOR π
Stevan Little <stevan.little@iinteractive.com> π
β COPYRIGHT AND LICENSE β
Copyright 2009, 2010 Infinity Interactive, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay π
okay bye bestie, that's the whole page π¦β¨ β this masterpiece was brought to you by perl v5.40.1, dated 2025-08-10, and it's Plack::Session(3pm) forever and always ππ
π¦ where this page comes from
- ubuntu resolute: libplack-middleware-session-perl 0.36-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libplack-middleware-session-perl 0.36-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms