| 1 | use strict; | ||
| 2 | package Web::Authenticate::Cookie::Handler::Role; | ||
| 3 | $Web::Authenticate::Cookie::Handler::Role::VERSION = '0.003'; | ||
| 4 | use Mouse::Role; | ||
| 5 | #ABSTRACT: A Mouse::Role that defines what methods a Web::Authenticate::Cookie::Handler object should contain. | ||
| 6 | |||
| 7 | |||
| 8 | requires 'set_cookie'; | ||
| 9 | |||
| 10 | |||
| 11 | requires 'get_cookie'; | ||
| 12 | |||
| 13 | |||
| 14 | requires 'delete_cookie'; | ||
| 15 | |||
| 16 | 1; | ||
| 17 | |||
| 18 | __END__ | ||
| 19 | |||
| 20 | =pod | ||
| 21 | |||
| 22 | =encoding UTF-8 | ||
| 23 | |||
| 24 | =head1 NAME | ||
| 25 | |||
| 26 | Web::Authenticate::Cookie::Handler::Role - A Mouse::Role that defines what methods a Web::Authenticate::Cookie::Handler object should contain. | ||
| 27 | |||
| 28 | =head1 VERSION | ||
| 29 | |||
| 30 | version 0.003 | ||
| 31 | |||
| 32 | =head1 METHODS | ||
| 33 | |||
| 34 | =head2 set_cookie | ||
| 35 | |||
| 36 | Creates a session for user and sets it on the browser. expires must be the number of seconds from now | ||
| 37 | when the cookie should expire. | ||
| 38 | |||
| 39 | $cookie_handler->set_cookie($name, $value, $expires_in_seconds); | ||
| 40 | |||
| 41 | =head2 get_cookie | ||
| 42 | |||
| 43 | Gets the value of the cookie with name. Returns undef if there is no cookie with that name, or it has expired. | ||
| 44 | |||
| 45 | my $cookie_value = $cookie_handler->get_cookie($name); | ||
| 46 | |||
| 47 | =head2 delete_cookie | ||
| 48 | |||
| 49 | Deletes cookie with name if it exists. | ||
| 50 | |||
| 51 | $cookie_handler->delete_cookie($name); | ||
| 52 | |||
| 53 | =head1 AUTHOR | ||
| 54 | |||
| 55 | Adam Hopkins <srchulo@cpan.org> | ||
| 56 | |||
| 57 | =head1 COPYRIGHT AND LICENSE | ||
| 58 | |||
| 59 | This software is copyright (c) 2017 by Adam Hopkins. | ||
| 60 | |||
| 61 | This is free software; you can redistribute it and/or modify it under | ||
| 62 | the same terms as the Perl 5 programming language system itself. | ||
| 63 | |||
| 64 | =cut |