| 1 | package Mojolicious::Sessions::ThreeS::Storage; | ||
| 2 | 3 | $Mojolicious::Sessions::ThreeS::Storage::VERSION = '0.004'; | |
| 3 | 3 | ▶ | use Mojo::Base -base; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 3 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | =head1 NAME | ||
| 7 | |||
| 8 | Mojolicious::Sessions::ThreeS::Storage - Abstract session storage base class | ||
| 9 | |||
| 10 | =head1 SYNOPSIS | ||
| 11 | |||
| 12 | Implement a subclass of this using C<Mojo::Base> and implement | ||
| 13 | all methods marked as ABSTRACT. | ||
| 14 | |||
| 15 | =cut | ||
| 16 | |||
| 17 | =head2 get_session | ||
| 18 | |||
| 19 | ABSTRACT | ||
| 20 | |||
| 21 | Gets the session C<HashRef> from the given Id. Can return undef if the session | ||
| 22 | is expired or gone. | ||
| 23 | |||
| 24 | Called by the framework like this: | ||
| 25 | |||
| 26 | if( my $session = $this->get_session( $session_id ) ){ | ||
| 27 | ... | ||
| 28 | } | ||
| 29 | |||
| 30 | =cut | ||
| 31 | |||
| 32 | 0 | ▶ | sub get_session{ |
|
Subroutine
get_session: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 33 | 0 | confess("Implement this"); | |
| 34 | } | ||
| 35 | |||
| 36 | =head2 store_session | ||
| 37 | |||
| 38 | ABSTRACT | ||
| 39 | |||
| 40 | Stores the session C<HashRef> against the given ID. Called by the framework like this: | ||
| 41 | |||
| 42 | $this->store_session( $session_id , $session ); | ||
| 43 | |||
| 44 | Note that the session might contain an C<expires> Epoch time (in seconds). You should | ||
| 45 | try to implement this expiry yourself to the best of the underlying storage ability. | ||
| 46 | |||
| 47 | =cut | ||
| 48 | |||
| 49 | 0 | ▶ | sub store_session{ |
|
Subroutine
store_session: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 50 | 0 | confess("Implement this"); | |
| 51 | } | ||
| 52 | |||
| 53 | =head2 remove_session_id | ||
| 54 | |||
| 55 | ABSTRACT | ||
| 56 | |||
| 57 | Removes the session with the given session_id from the storage. This is idem-potent. | ||
| 58 | |||
| 59 | Called by the framework like this: | ||
| 60 | |||
| 61 | $this->remove_session_id( $session_id ); | ||
| 62 | |||
| 63 | =cut | ||
| 64 | |||
| 65 | 0 | ▶ | sub remove_session_id{ |
|
Subroutine
remove_session_id: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 66 | 0 | confess("Implement this"); | |
| 67 | } | ||
| 68 | |||
| 69 | 3 | 1; | |