Data::...:Static(3pm)
π NAME π
Data::Session::ID::Static β a persistent session manager, bestie. That's the whole vibe. It lives in the Data::Session family (the manual calls it Data::Session::ID::Static(3pm), Perl documentation, user contributed, iykyk).
β¨ Synopsis β¨
Real talk, this page is short on purpose. For the actual details:
See Data::Session for details.
πΈ Description πΈ
So Data::Session::ID::Static lets Data::Session generate a static (aka constant) session id. It's giving "the same id, every single time, on purpose." No randomness, no drama, just consistency. π
To use this module, do this:
- Specify an id generator of type Static, like this:
Data::Session -> new(type => '... id:Static ...')
π Case-sensitive Options π
Okay bestie, important: see "Case-sensitive Options" in Data::Session for the crucial info. Don't skip it, fr fr.
π¦ Method: new() π¦
Creates a new object of type Data::Session::ID::Static. Iconic of it.
new() takes a hash of key/value pairs, some of which might be mandatory. Also, some combinations might be mandatory. So yeah, read carefully.
The keys are listed here in alphabetical order.
They're all lower-case because they are (also) method names β meaning you can call them to set or get the value at literally any time. Main character energy. π
id => $stringβ Specifies the static (constant) id to 'generate'. This key is normally passed in asData::Session -> new(id => $string). Default:0. This key is mandatory, and it can't be 0. (Yes, the default is0and it's also not allowed to be0. That's just the lore. π)verbose => $integerβ Prints more or less information toSTDERR. Typical values are0,1and2. This key is normally passed in asData::Session -> new(verbose => $integer). This key is optional. π
π Method: generate() π
Generates the next session id β which is always whatever was passed in to new(id => ...) β or dies if it can't. So either you get your id or it's over. π
Returns the new id.
β Method: id_length() β
Returns 32, because that's the classic value of the size of the id field in the sessions table. A legend. A classic. Periodt.
This can be used to generate the SQL to create the sessions table. So handy. π«Ά
π Support π
Log a bug on RT: <https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Session>.
π Author π
Data::Session was written by Ron Savage <ron@savage.net.au> in 2010.
Home page: <http://savage.net.au/index.html>.
πΈ Copyright πΈ
Australian copyright (c) 2010, Ron Savage.
All Programs of mine are 'OSI Certified Open Source Software';
you can redistribute them and/or modify them under the terms of
The Artistic License, a copy of which is available at:
http://www.opensource.org/licenses/index.html
Okay that's the whole page, bestie. Every flag, every default, every warning β nothing left out, we ate that. π β¨
Signing off cute: this doc is for perl v5.36.0, dated 2023-02-14. Slay, go generate some static ids. ππ¦π
π¦ where this page comes from
- debian trixie: libdata-session-perl 1.18-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdata-session-perl 1.18-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdata-session-perl 1.18-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdata-session-perl 1.18-2 Β· 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