.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Catalyst::Plugin::Session::State::Cookie 3pm" .TH Catalyst::Plugin::Session::State::Cookie 3pm "2020-08-31" "perl v5.30.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Catalyst::Plugin::Session::State::Cookie \- Maintain session IDs using cookies. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Catalyst qw/Session Session::State::Cookie Session::Store::Foo/; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" In order for Catalyst::Plugin::Session to work the session \s-1ID\s0 needs to be stored on the client, and the session data needs to be stored on the server. .PP This plugin stores the session \s-1ID\s0 on the client using the cookie mechanism. .SH "METHODS" .IX Header "METHODS" .IP "make_session_cookie" 4 .IX Item "make_session_cookie" Returns a hash reference with the default values for new cookies. .ie n .IP "update_session_cookie $hash_ref" 4 .el .IP "update_session_cookie \f(CW$hash_ref\fR" 4 .IX Item "update_session_cookie $hash_ref" Sets the cookie based on \f(CW\*(C`cookie_name\*(C'\fR in the response object. .IP "calc_expiry" 4 .IX Item "calc_expiry" .PD 0 .IP "calculate_session_cookie_expires" 4 .IX Item "calculate_session_cookie_expires" .IP "cookie_is_rejecting" 4 .IX Item "cookie_is_rejecting" .IP "delete_session_id" 4 .IX Item "delete_session_id" .IP "extend_session_id" 4 .IX Item "extend_session_id" .IP "get_session_cookie" 4 .IX Item "get_session_cookie" .IP "get_session_id" 4 .IX Item "get_session_id" .IP "set_session_id" 4 .IX Item "set_session_id" .PD .SH "EXTENDED METHODS" .IX Header "EXTENDED METHODS" .IP "prepare_cookies" 4 .IX Item "prepare_cookies" Will restore if an appropriate cookie is found. .IP "finalize_cookies" 4 .IX Item "finalize_cookies" Will set a cookie called \f(CW\*(C`session\*(C'\fR if it doesn't exist or if its value is not the current session id. .IP "setup_session" 4 .IX Item "setup_session" Will set the \f(CW\*(C`cookie_name\*(C'\fR parameter to its default value if it isn't set. .SH "CONFIGURATION" .IX Header "CONFIGURATION" .IP "cookie_name" 4 .IX Item "cookie_name" The name of the cookie to store (defaults to \f(CW\*(C`Catalyst::Utils::apprefix($c) . \*(Aq_session\*(Aq\*(C'\fR). .IP "cookie_domain" 4 .IX Item "cookie_domain" The name of the domain to store in the cookie (defaults to current host) .IP "cookie_expires" 4 .IX Item "cookie_expires" Number of seconds from now you want to elapse before cookie will expire. Set to 0 to create a session cookie, ie one which will die when the user's browser is shut down. .IP "cookie_secure" 4 .IX Item "cookie_secure" If this attribute \fBset to 0\fR the cookie will not have the secure flag. .Sp If this attribute \fBset to 1\fR (or true for backward compatibility) \- the cookie sent by the server to the client will get the secure flag that tells the browser to send this cookie back to the server only via \s-1HTTPS.\s0 .Sp If this attribute \fBset to 2\fR then the cookie will get the secure flag only if the request that caused cookie generation was sent over https (this option is not good if you are mixing https and http in your application). .Sp Default value is 0. .IP "cookie_httponly" 4 .IX Item "cookie_httponly" If this attribute \fBset to 0\fR, the cookie will not have HTTPOnly flag. .Sp If this attribute \fBset to 1\fR, the cookie will got HTTPOnly flag that should prevent client side Javascript accessing the cookie value \- this makes some sort of session hijacking attacks significantly harder. Unfortunately not all browsers support this flag (\s-1MSIE 6 SP1+,\s0 Firefox 3.0.0.6+, Opera 9.5+); if a browser is not aware of HTTPOnly the flag will be ignored. .Sp Default value is 1. .Sp Note1: Many people are confused by the name \*(L"HTTPOnly\*(R" \- it \fBdoes not mean\fR that this cookie works only over \s-1HTTP\s0 and not over \s-1HTTPS.\s0 .Sp Note2: This parameter requires Catalyst::Runtime 5.80005 otherwise is skipped. .IP "cookie_samesite" 4 .IX Item "cookie_samesite" This attribute configures the value of the SameSite flag. .Sp If set to None, the cookie will be sent when making cross origin requests, including following links from other origins. This requires the \&\*(L"cookie_secure\*(R" flag to be set. .Sp If set to Lax, the cookie will not be included when embedded in or fetched from other origins, but will be included when following cross origin links. .Sp If set to Strict, the cookie will not be included for any cross origin requests, including links from different origins. .Sp Default value is \f(CW\*(C`Lax\*(C'\fR. This is the default modern browsers use. .Sp Note: This parameter requires Catalyst::Runtime 5.90125 otherwise is skipped. .IP "cookie_path" 4 .IX Item "cookie_path" The path of the request url where cookie should be baked. .PP For example, you could stick this in MyApp.pm: .PP .Vb 3 \& _\|_PACKAGE_\|_\->config( \*(AqPlugin::Session\*(Aq => { \& cookie_domain => \*(Aq.mydomain.com\*(Aq, \& }); .Ve .SH "CAVEATS" .IX Header "CAVEATS" Sessions have to be created before the first write to be saved. For example: .PP .Vb 6 \& sub action : Local { \& my ( $self, $c ) = @_; \& $c\->res\->write("foo"); \& $c\->session( ... ); \& ... \& } .Ve .PP Will cause a session \s-1ID\s0 to not be set, because by the time a session is actually created the headers have already been sent to the client. .SH "SEE ALSO" .IX Header "SEE ALSO" Catalyst, Catalyst::Plugin::Session. .SH "AUTHORS" .IX Header "AUTHORS" Yuval Kogman .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" This module is derived from Catalyst::Plugin::Session::FastMmap code, and has been heavily modified since. .PP Andrew Ford .PP Andy Grundman .PP Christian Hansen .PP Marcus Ramberg .PP Jonathan Rockway .PP Sebastian Riedel .PP Florian Ragwitz .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2005 \- 2009 the Catalyst::Plugin::Session::State::Cookie \*(L"\s-1AUTHORS\*(R"\s0 and \*(L"\s-1CONTRIBUTORS\*(R"\s0 as listed above. .SH "LICENSE" .IX Header "LICENSE" This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.