The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Maplat::Web::SessionSettings - save and load session/module specific data

SYNOPSIS

This module provides handling module-specific data handling on a per session basis

DESCRIPTION

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.

Configuration

        <module>
                <modname>sessionsettings</modname>
                <pm>SessionSettings</pm>
                <options>
                        <memcache>memcache</memcache>
                        <db>maindb</db>
                        <login>authentification</login>
                </options>
        </module>

WARNING

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.

set

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.

get

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);

delete

This function deletes a setting from database and returns a boolean to indicate success or failure.

It takes one arguments, $settingname is the key name of the setting.

  $is_ok = $us->delete($settingname);

list

This function lists all available settings for a session.

  @settingnames = $us->list();

on_login

Internal function.

on_logout

Internal function.

on_refresh

Internal function.

Dependencies

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"

SEE ALSO

Maplat::Web Maplat::Web::Memcache Maplat::Web::Login

AUTHOR

Rene Schickbauer, <rene.schickbauer@gmail.com>

COPYRIGHT AND LICENSE

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.