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.207000
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::SessionFactory::XYX
23
24           use Moo;
25
26           has _suffix => (
27               is      => 'ro',
28               isa     => 'Str',
29               default => sub { '.xyz' },
30           );
31
32           with 'Dancer2::Core::Role::SessionFactory::File';
33
34           sub _freeze_to_handle {
35               my ($self, $fh, $data) = @_;
36
37               # ... do whatever to get data into $fh
38
39               return;
40           }
41
42           sub _thaw_from_handle {
43               my ($self, $fh) = @_;
44               my $data;
45
46               # ... do whatever to get data from $fh
47
48               return $data;
49           }
50
51           1;
52

ATTRIBUTES

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

AUTHOR

58       Dancer Core Developers
59
61       This software is copyright (c) 2018 by Alexis Sukrieh.
62
63       This is free software; you can redistribute it and/or modify it under
64       the same terms as the Perl 5 programming language system itself.
65
66
67
68perl v5.28.0                      2D0a1n8c-e1r12-:1:4Core::Role::SessionFactory::File(3)
Impressum