06 Jun 2021 17:32:08 UTC
- Distribution: Dancer2
- Module version: 0.301004
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Issues (122)
- Testers (783 / 3 / 0)
- KwaliteeBus factor: 3
- 84.81% Coverage
- License: perl_5
- Activity24 month
- Download (391.12KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:78 non-PAUSE usersCROMEDOME Jason A. Cromeand 1 contributors
- Dancer Core Developers
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- COPYRIGHT AND LICENSE
Dancer2::Core::Session - class to represent any session object
A session object encapsulates anything related to a specific session: its ID, its data, and its expiration.
It is completely agnostic of how it will be stored, this is the role of a factory that consumes Dancer2::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 app object if a session engine is defined.
The identifier of the session object. Required. By default, Dancer2::Core::Role::SessionFactory sets this to a randomly-generated, guaranteed-unique string.
This attribute can be modified if your Session implementation requires this.
Contains the data of the session (Hash).
Number of seconds for the expiry of the session cookie. Don't add the current timestamp to it, will be done automatically.
Default is no expiry (session cookie will leave for the whole browser's session).
For a lifetime of one hour:
expires => 3600
Boolean value for whether data in the session has been modified.
Reader on the session data
my $value = $session->read('something');
undefif the key does not exist in the session.
Writer on the session data
is_dirtyto true. Returns
Deletes a key from session data
is_dirtyto true. Returns the value deleted from the session.
Dancer Core Developers
This software is copyright (c) 2021 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.