1Dancer2::Core::Role::SeUssseironCFoancttroirbyuD:ta:enFdcielPree2(r:3l:)CDoorceu:m:eRnotlaet:i:oSnessionFactory::File(3)
2
3
4

NAME

6       Dancer2::Core::Role::SessionFactory::File - Role for file-based session
7       factories
8

VERSION

10       version 0.400000
11

DESCRIPTION

13       This is a specialized SessionFactory role for storing session data in
14       files.
15
16       This role manages the files.  Classes consuming it only need to handle
17       serialization and deserialization.
18
19       Classes consuming this must satisfy three requirements: "_suffix",
20       "_freeze_to_handle" and "_thaw_from_handle".
21
22           package Dancer2::Session::XYX;
23
24           use Dancer2::Core::Types;
25           use Moo;
26
27           has _suffix => (
28               is      => 'ro',
29               isa     => Str,
30               default => sub { '.xyz' },
31           );
32
33           with 'Dancer2::Core::Role::SessionFactory::File';
34
35           sub _freeze_to_handle {
36               my ($self, $fh, $data) = @_;
37
38               # ... do whatever to get data into $fh
39
40               return;
41           }
42
43           sub _thaw_from_handle {
44               my ($self, $fh) = @_;
45               my $data;
46
47               # ... do whatever to get data from $fh
48
49               return $data;
50           }
51
52           1;
53

ATTRIBUTES

55   session_dir
56       Where to store the session files.  Defaults to "./sessions".
57

AUTHOR

59       Dancer Core Developers
60
62       This software is copyright (c) 2022 by Alexis Sukrieh.
63
64       This is free software; you can redistribute it and/or modify it under
65       the same terms as the Perl 5 programming language system itself.
66
67
68
69perl v5.36.0                      2D0a2n3c-e0r12-:2:0Core::Role::SessionFactory::File(3)
Impressum