Data::...rement(3pm)
β¨ NAME β¨
Data::Session::ID::AutoIncrement β a persistent session manager π
(this is from the User Contributed Perl Documentation, bestie, aka the 3pm crew π«Ά)
πΈ Synopsis πΈ
See Data::Session for details.
(that's it. that's the whole synopsis. iconic behaviour honestly π )
π¦ Description π¦
Data::Session::ID::AutoIncrement lets Data::Session generate session ids. it's the little number-machine behind the curtain π
To use this module do this:
- Specify an id generator of type AutoIncrement, as
Data::Session -> new(type => '... id:AutoIncrement ...')
π Case-sensitive Options π
See "Case-sensitive Options" in Data::Session for important information.
(no seriously, go read it, it matters π«‘)
π Method: new() π
Creates a new object of type Data::Session::ID::AutoIncrement. brand new baby object, no cap π
new() takes a hash of key/value pairs, some of which might mandatory. Further, some combinations might be mandatory. (yes, it said "might mandatory". we're all doing our best π)
The keys are listed here in alphabetical order.
They are lower-case because they are (also) method names, meaning they can be called to set or get the value at any time. so like, two jobs, main character energy fr fr β¨
id_base=>$integerβ Specifies the base value for the auto-incrementing sessions ids.
This key is normally passed in as Data::Session -> new(id_base => $integer).
Note: The first id returned by generate() is id_base + id_step.
Default: 0.
This key is optional.
id_file=>$file_nameβ Specifies the file name in which to save the 'current' id.
This key is normally passed in as Data::Session -> new(id_file => $file_name).
Note: The next id returned by generate() is 'current' id + id_step.
Default: File::Spec -> catdir(File::Spec -> tmpdir, 'data.session.id').
The reason Data::Session -> new(directory => ...) is not used as the default directory is because this latter option is for where the session files are stored if the driver is File and the id generator is not AutoIncrement. (okay so THAT'S why, mystery solved bestie π)
This key is optional.
id_step=>$integerβ Specifies the amount to be added to the previous id to get the next id.
This key is normally passed in as Data::Session -> new(id_step => $integer).
Default: 1.
This key is optional.
no_flock=>$booleanβ Specifies (no_flock => 1) to not useflock()to obtain a lock on$file_name(which holds the 'current' id) before processing it, or (no_flock => 0) to useflock().
This key is normally passed in as Data::Session -> new(no_flock => $boolean).
Default: 0.
This key is optional.
umask=>$octal_valueβ Specifies the mode to use when callingsysopen()on$file_name.
This key is normally passed in as Data::Session -> new(umask => $octal_value).
Default: 0660.
This key is optional.
verbose=>$integerβ Print toSTDERRmore or less information.
Typical values are 0, 1 and 2.
This key is normally passed in as Data::Session -> new(verbose => $integer).
This key is optional.
π₯ Method: generate() π₯
Generates the next session id, or dies if it can't. π (literally dies, that's the actual behaviour, no drama added)
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.
This can be used to generate the SQL to create the sessions table. slay, SQL time π
π«Ά 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 and that's the whole page bestie!! π¦ this one shipped with perl v5.36.0 and is dated 2023-02-14 β yes, Valentine's Day, because this module loves you π go forth and auto-increment responsibly π β¨
π¦ 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