The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Dancer::Core::Session - class to represent any session object

VERSION

version 1.9999_02

DESCRIPTION

A session object encapsulates anything related to a specific session: it's ID, its data, creation timestampe...

It is completely agnostic of how it will be stored, this is the role of a factory that consumes Dancer::Core::Role::SessionFactory to know about that.

Generally, session objects should not be created directly. The correct way to get a new session object is to call the create() method on a session engine that implements the SessionFactory role. This is done automatically by the context object if a session engine is defined.

ATTRIBUTES

id

The identifier of the session object. Required. By default, Dancer::Core::Role::SessionFactory sets this to a randomly-generated, guaranteed-unique string.

is_secure

Boolean flag to tell if the session cookie is secure or not.

Default is false.

is_http_only

Boolean flag to tell if the session cookie is http only.

Default is true.

expires

Timestamp for the expiry of the session cookie.

Default is no expiry (session cookie will leave for the whole browser's session).

data

Contains the data of the session (Hash).

creation_time

A timestamp of the moment when the session was created.

METHODS

read

Reader on the session data

    my $value = $session->read('something');

write

Writer on the session data

Coerce the session object into a Dancer::Core::Cookie object.

AUTHOR

Dancer Core Developers

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Alexis Sukrieh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.