MVC::Neaf::X::Session::Base - session engine base class & tooling for Not Even A Framework.
package My::Session::Engine; use parent qw(MVC::Neaf::X::Session::Base); sub store { ... }; sub fetch { ... }; 1;
%options may include:
session_ttl - how long until session expires (not given = don't expire).
session_renewal_ttl - how long until session is forcibly re-saved and updated. Defaults to session_ttl * some_fraction. 0 means don't do this at all.
Save session data. Returns hash with keys id and expire. Returned id MAY differ from the given one, and must be honored in such case.
Load session by id. A hash containing session data, id, and expiration time is returned.
Session is re-saved if time has come to update it.
Caclulate expiration time, if applicable.
Tell if session expiring by $time needs to be renewed.
Stub, to be redefined by real storage access method. Return is expected as { data => stringified_session }.
Stub, to be redefined by real storage access method.
Must return false value or a hash with following fields (all optional):
id - indicates that id has changed and/or client session needs update;
expire - indicates that expiration date has changed and/or needs update;
strfy - stringified session data;
override - hash with individual fields that would override decoded content.
This module is part of MVC::Neaf suite.
Copyright 2016-2019 Konstantin S. Uvarin khedin@cpan.org.
khedin@cpan.org
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install MVC::Neaf, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MVC::Neaf
CPAN shell
perl -MCPAN -e shell install MVC::Neaf
For more information on module installation, please visit the detailed CPAN module installation guide.