MVC::Neaf::X::Session::File - File-based sessions for Not Even A Framework.
This module implements session storage, as described in MVC::Neaf::X::Session.
It will store session data inside a single directory. The file format is JSON but MAY change in the future.
Uses flock() to avoid collisions.
If session_ttl was specified, old session files will be deleted.
NOTE The file-locking MAY be prone to race conditions. If you want real secure expiration, please specify expiration INSIDE the session, or use a database.
use strict; use warnings; use MVC::Neaf; use MVC::Neaf::X::Session::File; MVC::Neaf->set_session_engine( engine => MVC::Neaf::X::Session::File->new( dir => $mydir ) ); # ... define your application here
Constructor. %options may include:
session_ttl - how long to store session data.
dir (required) - where to store files.
Save session data to a file.
Load session data from file. Will DELETE session if session_ttl was specified and exceeded.
Remove a session, if such session is stored at all.
Internal mechanism beyond load_file.
Internal mechanism beyond save_session.
Convert id into filename.
Currently JSON is used.
This module is part of MVC::Neaf suite.
Copyright 2016-2018 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.