Plack:...::Store(3pm)

πŸ’– Plack::Session::Store πŸ’–

okay bestie, so this is the manual page for Plack::Session::Store (that's the 3pm one, obvi) β€” and it's literally the chillest little session store you'll ever meet. it keeps everything in memory, it's adorable, and it's here to help you understand the whole Plack::Session::Store::* family. let's get into it 🫢


✨ NAME ✨

Plack::Session::Store β€” a basic in-memory session store. yep, that's the whole pitch, and honestly? iconic. πŸ’…


🌸 SYNOPSIS 🌸

here's the vibe, copy-paste ready:

use Plack::Builder;
use Plack::Middleware::Session;
use Plack::Session::Store;

my $app = sub {
    return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello Foo' ] ];
};

builder {
    enable 'Session'; # this is the default store
    $app;
};

like yes, enable 'Session' and you're done, because this is the default store. no extra setup, no drama. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so, this is a very basic in-memory session data store. it's volatile storage, which is the fancy way of saying "it forgets everything the moment it goes away." and it is NOT recommended for multiprocessing environments β€” fr fr, do not do that to yourself. πŸ’€

BUT. it is very useful for development and testing, which is where it absolutely eats. it's giving "perfect for your local setup" energy. πŸ”₯

also, you should think of this as the store "base" class (though, lowkey, subclassing is not a requirement β€” you're free, bestie) and it defines the spec for all Plack::Session::Store::* modules. so if you do end up subclassing, you'll literally only need to override a couple of methods. see the other Plack::Session::Store::* modules for examples of this β€” they're the blueprint, iykyk. ✨


πŸ‘‘ METHODS πŸ‘‘

new ( %params )

no parameters are expected by this constructor. it just works. main character energy, honestly. πŸ’…

πŸ“ Session Data Management

these methods fetch data from the session storage. the whole design is meant to store or delete multiple keys at a time, so it's efficient and unbothered. 🌈

  • fetch ( $session_id ) β€” grabs your session data, based on the $session_id you hand it.
  • store ( $session_id, $session ) β€” tucks your $session data away under that $session_id. remember, this is memory-only, so it's a temporary little home. πŸ™ˆ

🧚 Storage Management

  • remove ( $session_id ) β€” this one gets called by the Plack::Session "expire" method, and it's the one in charge of removing any session data. bye-bye session, you were lovely. πŸ‘‹

πŸ’€ 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. do it for the girls (the girls are the perl community).


🌟 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, open source. πŸ’–


and that's the whole page, bestie! 🫢 this was written for perl v5.40.1 and dated 2025-08-10 β€” and it's the Plack:...::Store(3pm) page, so now you know exactly where you are. go forth and store some sessions (in memory, temporarily, respectfully). βœ¨πŸŒΈπŸ’…

πŸ“¦ where this page comes from