The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mojolicious::Sessions:ThreeS - A Mojolicious Sessions manager that supports controlling Storage, State and Sid generation.

SYNOPSIS

You can use this directly when you build your mojolicious App:

package My::App;
use Mojo::Base 'Mojolicious';

use Mojolicious::Sessions:ThreeS;

sub startup{
  my ($app) = @_;
  ...
  $app->sessions( Mojolicious::Sessions:ThreeS->new({ storage => ... , state => ... , sidgen => ... } ) );
  ...
}

Or as a plugin, with exactly the same arguments. See Mojolicious::Plugin::Sessions3S.

new

Builds an instance of this given the following properties (all optional):

storage

An instance of a subclass of Mojolicious::Sessions::ThreeS::Storage. Defaults to undef

When not given, this will consider itself inactive and fallback to the default Mojolicious::Sessions behaviour.

state

An instance of a subclass of Mojolicious::Sessions::ThreeS::State. Defaults to an instance of Mojolicious::Sessions::ThreeS::State::Cookie.

sidgen

An Session ID generator, instance of Mojolicious::Sessions::ThreeS::SidGen. Defaults to an instance of Mojolicious::Sessions::ThreeS::SidGen::Simple.

was_set

This was set with explicit store, storage and sid generator.

Usage:

if ( $this->was_set() ){
   ...
}

From Mojolicious::Sessions. Delegate to the underlying Cookie based state. Use this only if you know the state object supports cookies.

From Mojolicious::Sessions. Delegate to the underlying Cookie based state. Use this only if you know the state object supports cookies.

From Mojolicious::Sessions. Delegate to the underlying Cookie based state. Use this only if you know the state object supports cookies.

secure

From Mojolicious::Sessions. Delegate to the underlying Cookie based state. Use this only if you know the state object supports cookies.

load

Implements load from Mojolicious::Sessions

store

Implements store from Mojolicious::Sessions

get_session_id

Get the current session ID or generate a fresh one and store it in the given session object, using the given controller.

Usage:

my $session_id = $this->session_id( $session, $controller );