1Catalyst::Plugin::SessiUosne:r:SCtoantter:i:bCuotCoeakdtiaePl(ey3rs)lt:D:oPcluumgeinnt:a:tSieosnsion::State::Cookie(3)
2
3
4

NAME

6       Catalyst::Plugin::Session::State::Cookie - Maintain session IDs using
7       cookies.
8

SYNOPSIS

10           use Catalyst qw/Session Session::State::Cookie Session::Store::Foo/;
11

DESCRIPTION

13       In order for Catalyst::Plugin::Session to work the session ID needs to
14       be stored on the client, and the session data needs to be stored on the
15       server.
16
17       This plugin stores the session ID on the client using the cookie
18       mechanism.
19

METHODS

21       make_session_cookie
22           Returns a hash reference with the default values for new cookies.
23
24       update_session_cookie $hash_ref
25           Sets the cookie based on "cookie_name" in the response object.
26
27       calc_expiry
28       calculate_session_cookie_expires
29       cookie_is_rejecting
30       delete_session_id
31       extend_session_id
32       get_session_cookie
33       get_session_id
34       set_session_id
35

EXTENDED METHODS

37       prepare_cookies
38           Will restore if an appropriate cookie is found.
39
40       finalize_cookies
41           Will set a cookie called "session" if it doesn't exist or if its
42           value is not the current session id.
43
44       setup_session
45           Will set the "cookie_name" parameter to its default value if it
46           isn't set.
47

CONFIGURATION

49       cookie_name
50           The name of the cookie to store (defaults to
51           "Catalyst::Utils::apprefix($c) . '_session'").
52
53       cookie_domain
54           The name of the domain to store in the cookie (defaults to current
55           host)
56
57       cookie_expires
58           Number of seconds from now you want to elapse before cookie will
59           expire.  Set to 0 to create a session cookie, ie one which will die
60           when the user's browser is shut down.
61
62       cookie_secure
63           If this attribute set to 0 the cookie will not have the secure
64           flag.
65
66           If this attribute set to 1 (or true for backward compatibility) -
67           the cookie sent by the server to the client will get the secure
68           flag that tells the browser to send this cookie back to the server
69           only via HTTPS.
70
71           If this attribute set to 2 then the cookie will get the secure flag
72           only if the request that caused cookie generation was sent over
73           https (this option is not good if you are mixing https and http in
74           your application).
75
76           Default value is 0.
77
78       cookie_httponly
79           If this attribute set to 0, the cookie will not have HTTPOnly flag.
80
81           If this attribute set to 1, the cookie will got HTTPOnly flag that
82           should prevent client side Javascript accessing the cookie value -
83           this makes some sort of session hijacking attacks significantly
84           harder. Unfortunately not all browsers support this flag (MSIE 6
85           SP1+, Firefox 3.0.0.6+, Opera 9.5+); if a browser is not aware of
86           HTTPOnly the flag will be ignored.
87
88           Default value is 1.
89
90           Note1: Many people are confused by the name "HTTPOnly" - it does
91           not mean that this cookie works only over HTTP and not over HTTPS.
92
93           Note2: This parameter requires Catalyst::Runtime 5.80005 otherwise
94           is skipped.
95
96       cookie_samesite
97           This attribute configures the value of the SameSite
98           <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-
99           Cookie/SameSite> flag.
100
101           If set to None, the cookie will be sent when making cross origin
102           requests, including following links from other origins. This
103           requires the "cookie_secure" flag to be set.
104
105           If set to Lax, the cookie will not be included when embedded in or
106           fetched from other origins, but will be included when following
107           cross origin links.
108
109           If set to Strict, the cookie will not be included for any cross
110           origin requests, including links from different origins.
111
112           Default value is "Lax". This is the default modern browsers use.
113
114           Note: This parameter requires Catalyst::Runtime 5.90125 otherwise
115           is skipped.
116
117       cookie_path
118           The path of the request url where cookie should be baked.
119
120       For example, you could stick this in MyApp.pm:
121
122           __PACKAGE__->config( 'Plugin::Session' => {
123               cookie_domain  => '.mydomain.com',
124           });
125

CAVEATS

127       Sessions have to be created before the first write to be saved. For
128       example:
129
130           sub action : Local {
131               my ( $self, $c ) = @_;
132               $c->res->write("foo");
133               $c->session( ... );
134               ...
135           }
136
137       Will cause a session ID to not be set, because by the time a session is
138       actually created the headers have already been sent to the client.
139

SEE ALSO

141       Catalyst, Catalyst::Plugin::Session.
142

AUTHORS

144       Yuval Kogman <nothingmuch@woobling.org>
145

CONTRIBUTORS

147       This module is derived from Catalyst::Plugin::Session::FastMmap code,
148       and has been heavily modified since.
149
150       Andrew Ford
151
152       Andy Grundman
153
154       Christian Hansen
155
156       Marcus Ramberg
157
158       Jonathan Rockway <jrockway@cpan.org>
159
160       Sebastian Riedel
161
162       Florian Ragwitz
163
165       Copyright (c) 2005 - 2009 the Catalyst::Plugin::Session::State::Cookie
166       "AUTHORS" and "CONTRIBUTORS" as listed above.
167

LICENSE

169       This program is free software, you can redistribute it and/or modify it
170       under the same terms as Perl itself.
171
172
173
174perl v5.36.0                      20C2a2t-a0l7y-s2t2::Plugin::Session::State::Cookie(3)
Impressum