| Data::Session::Driver::Memcached |
new()remove($id)retrieve($id)traverse()
the Data::Session::Driver::Memcached manpage - A persistent session manager
See the Data::Session manpage for details.
the Data::Session::Driver::Memcached manpage allows the Data::Session manpage to manipulate sessions the Cache::Memcached manpage.
To use this module do both of these:
See scripts/memcached.pl.
See Case-sensitive Options in the Data::Session manpage for important information.
new()Creates a new object of type the Data::Session::Driver::Memcached manpage.
new() takes a hash of key/value pairs, some of which might mandatory. Further, some combinations
might be mandatory.
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.
Specifies the object of type the Cache::Memcached manpage to use for session storage.
This key is normally passed in as Data::Session -> new(cache => $object).
This key is mandatory.
Print to STDERR more 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.
remove($id)Deletes from storage the session identified by $id.
Returns the result of calling the the Cache::Memcached manpage method delete($id).
This result is a Boolean value indicating 1 => success or 0 => failure.
retrieve($id)Retrieve from storage the session identified by $id.
Returns the result of calling the the Cache::Memcached manpage method get($id).
This result is a frozen session. This value must be thawed by calling the appropriate serialization
driver's thaw() method.
the Data::Session manpage calls the right thaw() automatically.
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 the Cache::Memcached manpage, too.
Returns the result of calling the the Cache::Memcached manpage method set($id, $data, $time).
This result is a Boolean value indicating 1 => success or 0 => failure.
Note: $time is 0 for sessions which don't expire. If you wish to pass undef or 'never', as per the
the Cache::Memcached manpage documentation, you will have to subclass the Cache::Memcached manpage and override the
set() method to change 0 to 'never'.
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.
Returns 1.
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 &
Log a bug on RT: https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Session.
the Data::Session manpage was written by Ron Savage <ron@savage.net.au> in 2010.
Home page: http://savage.net.au/index.html.
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
| Data::Session::Driver::Memcached |