AxKit::XSP::Minisession - Yet Another Session Handling Library
In your config file:
PerlSetVar MinisessionDir /tmp/sessions PerlSetVar MinisessionLockDir /tmp/sessionlock AxAddXSPTaglib +AxKit::XSP::Minisession
In your XSP code:
<xsp:page xmlns:s="http://squash.oucs.ox.ac.uk/XSP/Minisession" > <s:set-value username="simon"/> <s:get-value>username</s:get-value>
In your Perl code:
die "Already logged in" if AxKit::XSP::Minisession::Backend::get_value($r, "username"); AxKit::XSP::Minisession::Backend::set_value($r, "username", $username);
This is a very simple session library which sets state via a cookie and uses Apache::Session::File to store sessions in files on the filesystem. If you need anything more complex than that, this module isn't for you.
Apache::Session::File
The guts of the module are the two functions get_value and set_value in the ::Backend module. The first parameter to these should be an Apache::Request object, and the second a hash key.
get_value
set_value
::Backend
Apache::Request
These functions are wrapped by the set-value and get-value tags from XSP.
set-value
get-value
And that's it. I said it was very simple.
Christopher H. Laco axkit@chrislaco.com - I've picked up maintainership of this module from Simon. With any luck I'll be able to add something aside from general house keeping skills.
axkit@chrislaco.com
Simon Cozens simon@cpan.org
simon@cpan.org
To install AxKit::XSP::Minisession, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AxKit::XSP::Minisession
CPAN shell
perl -MCPAN -e shell install AxKit::XSP::Minisession
For more information on module installation, please visit the detailed CPAN module installation guide.