Maplat::Web::SessionSettings - save and load session/module specific data
This module provides handling module-specific data handling on a per session basis
This module provides a simple interface to memcached for saving and loading module specific data on a per session basis. It can, for example, be used to save session specific filters to memcache. It can handle complex data structures.
Data is not permanently stored, but rather it's deleted when a user logs out or the session times out (auto user logout). Data is backed up by a DB with its own caching stragety.
<module> <modname>sessionsettings</modname> <pm>SessionSettings</pm> <options> <memcache>memcache</memcache> <db>maindb</db> <login>authentification</login> </options> </module>
This module implements its own memcached-based caching strategy. Use Maplat::Web::MemCache as the memcache module, don't use Maplat::Web::MemCachePg. While both will work and data will be stored permanently, using MemCachePg will generate some overhead, because the data will be saved redundatly in two places.
This function adds or updates a setting (data structure) in memcache.
It takes two arguments, $settingname is the key name of the setting, and $settingref is a reference to the data structure you want to store, e.g.:
$is_ok = $us->set($settingname, $settingref);
It returns a boolean to indicate success or failure.
This function reads a setting from memcached and returns a reference to the data structure.
It takes one arguments, $settingname is the key name of the setting.
$settingref = $us->get($settingname);
This function deletes a setting from database and returns a boolean to indicate success or failure.
$is_ok = $us->delete($settingname);
This function lists all available settings for a session.
@settingnames = $us->list();
Internal function.
This module depends on the following modules beeing configured (the 'as "somename"' means the key name in this modules configuration):
Maplat::Web::Memcache as "memcache" Maplat::Web::Login as "login"
Maplat::Web Maplat::Web::Memcache Maplat::Web::Login
Rene Schickbauer, <rene.schickbauer@gmail.com>
Copyright (C) 2008-2011 by Rene Schickbauer
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
To install Maplat, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Maplat
CPAN shell
perl -MCPAN -e shell install Maplat
For more information on module installation, please visit the detailed CPAN module installation guide.