Session(3pm)
πΈ NAME πΈ
HTML::Embperl::Session β it's Apache::Session but glowed up to work with HTML::Embperl, bestie π
β¨ DESCRIPTION β¨
okay so literally what it says on the tin: it's an adaptation of Apache::Session, but made to play nice with HTML::Embperl. that's the whole vibe. π¦
π SYNOPSIS π
π Addtional Attributes for TIE π
like yes, "Addtional" is spelled like that in the original, we don't fix lore here π«Ά these are the extra attributes you can hand to tie:
lazyβ set this and you're telling Apache::Session to ~chill~ and not touch the object store AT ALL until the tied hash gets its first read or write. without it,tiewill go ahead and make sure the hash exists, or spin up a brand new one. no cap, lazy is the main character here πcreate_unknownβ set this to one and Apache::Session will make a whole new session with the id you gave it (or a fresh id, it depends onrecreate_id) whenever that session id doesn't exist. if you don't set it? it dies. literally. πrecreate_idβ set this to one and Apache::Session generates a brand new session id when the one you specified doesn't exist. β¨object_storeβ here's where you name the class for the object store. (theApache::Session::prefix is optional, so you can be lazy about typing it.) only for Apache::Session 1.00, iykyk.lock_managerβ name the class for the lock manager here. (again,Apache::Session::prefix optional.) only for Apache::Session 1.00.Storeβ name the class for the object store. (theApache::Session::Storeprefix is optional.) only for Apache::Session 1.5x.Lockβ name the class for the lock manager. (theApache::Session::Lockprefix is optional.) only for Apache::Session 1.5x.Generateβ name the class for the id generator. (theApache::Session::Generateprefix is optional.) only for Apache::Session 1.5x.Serializeβ name the class for the data serializer. (theApache::Session::Serializeprefix is optional.) only for Apache::Session 1.5x.
and here's the example β using attrubtes (yes, "attrubtes", that's the original typo, we respect the elders π) to specify the store and object classes instead of making a derived class:
use HTML::Embperl::Session;
tie %session, 'HTML::Embperl::Session', undef,
{
object_store => 'DBIStore',
lock_manager => 'SysVSemaphoreLocker',
DataSource => 'dbi:Oracle:db'
};
NOTE: HTML::Embperl::Session will go and require all the necessary additional perl modules for you. it's got you, babe π«Ά
π Addtional Methods π
setidβ sets the session id so your future accesses use it. πgetidβ grabs the session id. the difference between this and just peeking at$session{_session_id}is that in lazy mode,getidwill NOT create a new session id if one doesn't exist yet. lowkey considerate of it π₯Ήcleanupβ writes out any pending data, releases every lock, and deletes all the data from memory. it's giving responsible queen closing up shop for the night π
π AUTHORS π
Gerald Richter <richter at embperl dot org> is the current maintainer β he's holding it down fr fr.
This class was written by Jeffrey Baker (jeffrey@kathyandjeffrey.net), but plot twist: it's taken wholesale from a patch that Gerald Richter (richter@ecos.de) sent against Apache::Session. iconic collaboration energy honestly π
and that's the whole page, bestie β this doc came to you courtesy of perl v5.34.0, dated 2022-02-06. slay, go tie some hashes πβ¨π
π¦ where this page comes from
- ubuntu jammy: libembperl-perl 2.5.0-16build1 Β· 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