| 1 | use strict; | ||
| 2 | package Web::Authenticate::Session::Storage::Handler::Role; | ||
| 3 | $Web::Authenticate::Session::Storage::Handler::Role::VERSION = '0.002'; | ||
| 4 | use Mouse::Role; | ||
| 5 | #ABSTRACT: A Mouse::Role that defines what methods a Web::Authenticate::Session::Storage::Handler object should contain. | ||
| 6 | |||
| 7 | |||
| 8 | requires 'store_session'; | ||
| 9 | |||
| 10 | |||
| 11 | requires 'load_session'; | ||
| 12 | |||
| 13 | |||
| 14 | |||
| 15 | requires 'delete_session'; | ||
| 16 | |||
| 17 | requires 'update_expires'; | ||
| 18 | |||
| 19 | |||
| 20 | requires 'invalidate_user_sessions'; | ||
| 21 | |||
| 22 | 1; | ||
| 23 | |||
| 24 | __END__ | ||
| 25 | |||
| 26 | =pod | ||
| 27 | |||
| 28 | =encoding UTF-8 | ||
| 29 | |||
| 30 | =head1 NAME | ||
| 31 | |||
| 32 | Web::Authenticate::Session::Storage::Handler::Role - A Mouse::Role that defines what methods a Web::Authenticate::Session::Storage::Handler object should contain. | ||
| 33 | |||
| 34 | =head1 VERSION | ||
| 35 | |||
| 36 | version 0.002 | ||
| 37 | |||
| 38 | =head1 METHODS | ||
| 39 | |||
| 40 | =head2 create_session | ||
| 41 | |||
| 42 | Creates a session for user in storage. Returns a L<Web::Authenticate::Session::Role> upon success, undef | ||
| 43 | upon failure. | ||
| 44 | |||
| 45 | my $session = $session_storage_handler->create_session($user, $session_id, $expires); | ||
| 46 | |||
| 47 | =head2 get_session | ||
| 48 | |||
| 49 | Gets the session with the session id $session_id, as long as it has not expired. | ||
| 50 | |||
| 51 | my $session = $session_storage_handler->get_session($session_id); | ||
| 52 | |||
| 53 | =head2 update_expires | ||
| 54 | |||
| 55 | Updates the time a session expires. | ||
| 56 | |||
| 57 | $session_storage_handler->update_expires($session_id, $expires); | ||
| 58 | |||
| 59 | =head2 delete_session | ||
| 60 | |||
| 61 | Deletes a session from storage. | ||
| 62 | |||
| 63 | $session_storage_handler->delete_session($session_id); | ||
| 64 | |||
| 65 | =head2 invalidate_user_sessions | ||
| 66 | |||
| 67 | Updates the time a session expires. | ||
| 68 | |||
| 69 | $session_storage_handler->invalidate_user_sessions($user); | ||
| 70 | |||
| 71 | =head1 AUTHOR | ||
| 72 | |||
| 73 | Adam Hopkins <srchulo@cpan.org> | ||
| 74 | |||
| 75 | =head1 COPYRIGHT AND LICENSE | ||
| 76 | |||
| 77 | This software is copyright (c) 2017 by Adam Hopkins. | ||
| 78 | |||
| 79 | This is free software; you can redistribute it and/or modify it under | ||
| 80 | the same terms as the Perl 5 programming language system itself. | ||
| 81 | |||
| 82 | =cut |