Dancer::Session::KiokuDB - KiokuDB Dancer session backend
version 0.05
# in your Dancer app: setting session => 'KiokuDB'; setting kiokudb_backend => 'DBI'; setting kiokudb_backend_opts => { dsn => 'dbi:SQLite:dbname=mydb.sqlite', }; # or in your Dancer config file: session: 'KiokuDB' kiokudb_backend: 'DBI' kiokudb_backend_opts: dsn: 'dbi:SQLite:dbname=mydb.sqlite'
When you want to save session information, you can pick from various session backends, and they each determine how the session information will be saved. You can use Dancer::Session::Cookie, Dancer::Session::MongoDB or... you use Dancer::Session::KiokuDB.
This backend uses KiokuDB to save and access session data.
A string which specifies what backend to use, under KiokuDB::Backend, that means that backend DBI will be KiokuDB::Backend::DBI. If you'll get smart and provide KiokuDB::Backend::Cool, you'll get KiokuDB::Backend::KiokuDB::Backend::Cool, which is, evidently, not cool! :)
KiokuDB::Backend
KiokuDB::Backend::DBI
KiokuDB::Backend::KiokuDB::Backend::Cool
Not mandatory.
The default backend is KiokuDB::Backend::Hash.
A hash reference which indicates options you want to send to the backend's new() method.
new()
The default opts are <create = 1>>. If you do not want it to automatically create, set:
<create =
# in your app set kiokudb_backend_opts => { create => 0, ... }; # or in your configuration kiokudb_backend_opts: create: 0
Initializes the object by loading the proper KiokuDB backend and creating the initial connection.
Creates a new object, runs flush and returns the object.
flush
Writes the session information to the KiokuDB session database.
Retrieves session information from the KiokuDB session database.
Deletes session information from the KiokuDB session database.
The Dancer Advent Calendar 2010.
Sawyer X <xsawyerx@cpan.org>
This software is copyright (c) 2010 by Sawyer X.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dancer::Session::KiokuDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Session::KiokuDB
CPAN shell
perl -MCPAN -e shell install Dancer::Session::KiokuDB
For more information on module installation, please visit the detailed CPAN module installation guide.