package Dancer2::Session::DBI;
use 5.006;
use strict;
use warnings;
use Moo;
use JSON;
use DBI;
use Carp qw( carp croak );
=encoding utf8
=head1 NAME
Dancer2::Session::DBI - DBI based session eng
the session and storing it
in a database via L<DBI>. The only supported serialization method is L<JSON>.
This was, so far, only tested with PostgreSQL but should in theory work
with MySQL and SQLite
re id=?");
$sth->execute($session_id);
my ($json) = $sth->fetchrow_array();
# Bail early if we know we have no session data at all
if (!defined $json) {
carp("Could not retrieve session ID: $se