Data::...cached(3pm)
β¨ NAME β¨
okay bestie, say hi to Data::...cached(3pm) π β the manual page for Data::Session::Driver::Memcached β A persistent session manager. Periodt.
πΈ Synopsis πΈ
See Data::Session for details. That's it, that's the vibe. π¦
π« Description π«
Data::Session::Driver::Memcached lets Data::Session manipulate sessions via Cache::Memcached. No cap. π«Ά
To use this module do both of these:
- Specify a driver of type
Memcached, asData::Session -> new(type => 'driver:Memcached ...') - Specify a cache object of type
Cache::MemcachedasData::Session -> new(cache => $object)
See scripts/memcached.pl. π
π Case-sensitive Options π
See "Case-sensitive Options" in Data::Session for important information. iykyk π
π Method: new() π
Creates a new object of type Data::Session::Driver::Memcached. β¨
new() takes a hash of key/value pairs, some of which might mandatory. Further, some combinations might be mandatory. (yes, the grammar is exactly like that in the original, bestie π)
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. iconic.
cache => $objectβ Specifies the object of typeCache::Memcachedto use for session storage.- This key is normally passed in as
Data::Session -> new(cache => $object). - This key is mandatory. π¨
- This key is normally passed in as
verbose => $integerβ Print toSTDERRmore or less information.- Typical values are
0,1and2. - This key is normally passed in as
Data::Session -> new(verbose => $integer). - This key is optional. πΈ
- Typical values are
π Method: remove($id) π
Deletes from storage the session identified by $id. bye bestie π
Returns the result of calling the Cache::Memcached method delete($id).
This result is a Boolean value indicating 1 => success or 0 => failure. π₯
π Method: retrieve($id) π
Retrieve from storage the session identified by $id. β¨
Returns the result of calling the Cache::Memcached method get($id).
This result is a frozen session. This value must be thawed by calling the appropriate serialization driver's thaw() method. π§β‘οΈπ§
Data::Session calls the right thaw() automatically. slay.
π Method: store($id, $data, $time) π
Writes to storage the session identified by $id, together with its data $data. The expiry time of the object is passed into the set() method of Cache::Memcached, too. π¦
Returns the result of calling the Cache::Memcached method set($id, $data, $time).
This result is a Boolean value indicating 1 => success or 0 => failure. β
/β
Note:$timeis0for sessions which don't expire. If you wish to passundefor'never', as per theCache::Memcacheddocumentation, you will have to subclassCache::Memcachedand override theset()method to change0to'never'. π
π Method: traverse() π
There is no mechanism (apart from memcached's debug code) to get a list of all keys in a cache managed by memcached, so there is no way to traverse them via this module. lowkey tragic π
Returns 1.
π οΈ Installing memcached π οΈ
Get libevent from http://www.monkey.org/~provos/libevent/
I used V 2.0.8-rc
./configure
make && make verify
sudo make install
It installs into /usr/local/lib, so tell memcached where to look:
LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH
Get memcached from http://memcached.org/
I used V 1.4.5
./configure --with-libevent=/usr/local/lib
make && make test
sudo make install
Running memcached:
memcached -m 5 &
π 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 bestie, that's the whole page! this was Data::...cached(3pm) from perl v5.36.0, dated 2023-02-14. stay hydrated, stay iconic π β¨π
π¦ 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