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 )
  • keys
  • session, 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 2009, 2010 Infinity Interactive, Inc.

<http://www.iinteractive.com>

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