| 1 | package Prancer::Session::State::Cookie; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings FATAL => 'all'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | use version; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | our $VERSION = '1.05'; | |
| 8 | |||
| 9 | 1 | ▶ | use Plack::Session::State::Cookie; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use parent qw(Plack::Session::State::Cookie); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 1 | 1; | |
| 13 | |||
| 14 | =head1 NAME | ||
| 15 | |||
| 16 | Prancer::Session::State::Cookie | ||
| 17 | |||
| 18 | =head1 SYNOPSIS | ||
| 19 | |||
| 20 | This package implements a session state handler that will keep track of | ||
| 21 | sessions by adding a cookie into the response headers and reading cookies in | ||
| 22 | the request headers. You must enable this if you want sessions to work. | ||
| 23 | |||
| 24 | To use this session state handler, add this to your configuration file: | ||
| 25 | |||
| 26 | session: | ||
| 27 | state: | ||
| 28 | driver: Prancer::Session::State::Cookie | ||
| 29 | options: | ||
| 30 | key: PSESSION | ||
| 31 | path: / | ||
| 32 | domain: .example.com | ||
| 33 | expires: 1800 | ||
| 34 | secure: 1 | ||
| 35 | httponly: 1 | ||
| 36 | |||
| 37 | =head1 OPTIONS | ||
| 38 | |||
| 39 | =over 4 | ||
| 40 | |||
| 41 | =item key | ||
| 42 | |||
| 43 | The name of the cookie. The default is B<PSESSION>. | ||
| 44 | |||
| 45 | =item path | ||
| 46 | |||
| 47 | The path of the cookie. This defaults to "/". | ||
| 48 | |||
| 49 | =item domain | ||
| 50 | |||
| 51 | The domain for the cookie. If this is not set then it will not be included in | ||
| 52 | the cookie. | ||
| 53 | |||
| 54 | =item expires | ||
| 55 | |||
| 56 | The expiration time of the cookie in seconds. If this is not set then it will | ||
| 57 | not be included in the cookie which means that sessions will expire at the end | ||
| 58 | of the user's browser session. | ||
| 59 | |||
| 60 | =item secure | ||
| 61 | |||
| 62 | The secure flag for the cookie. If this is not set then it will not be included | ||
| 63 | in the cookie. If this is set to a true value then the cookie will only be | ||
| 64 | transmitted over secure connections. | ||
| 65 | |||
| 66 | =item httponly | ||
| 67 | |||
| 68 | The HttpOnly flag for the cookie. If this is not set then it will not be | ||
| 69 | included in the cookie. If this is set to a true value then the cookie will | ||
| 70 | only be accessible by the server and not by, say, JavaScript. | ||
| 71 | |||
| 72 | =back | ||
| 73 | |||
| 74 | =cut | ||