.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" 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 "CGI::Cookie::Splitter 3pm" .TH CGI::Cookie::Splitter 3pm "2022-06-09" "perl v5.34.0" "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" CGI::Cookie::Splitter \- Split big cookies into smaller ones. .SH "VERSION" .IX Header "VERSION" version 0.05 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use CGI::Cookie::Splitter; \& \& my $splitter = CGI::Cookie::Splitter\->new( \& size => 123, # defaults to 4096 \& ); \& \& @small_cookies = $splitter\->split( @big_cookies ); \& \& @big_cookies = $splitter\->join( @small_cookies ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\s-1RFC 2109\s0 recommends that the minimal cookie size supported by the client is 4096 bytes. This has become a pretty standard value, and if your server sends larger cookies than that it's considered a no-no. .PP This module provides a pretty simple interface to generate small cookies that are under a certain limit, without wasting too much effort. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" .Vb 1 \& $splitter = CGI::Cookie::Splitter\->new(%params) .Ve .PP The only supported parameters right now are \f(CW\*(C`size\*(C'\fR. It defaults to 4096. .SS "split" .IX Subsection "split" .Vb 1 \& @cookies = $splitter\->split(@cookies) .Ve .PP This method accepts a list of CGI::Cookie objects (or lookalikes) and returns a list of CGI::Cookies. .PP Whenever an object with a total size that is bigger than the limit specified at construction time is encountered it is replaced in the result list with several objects of the same class, which are assigned serial names and have a smaller size and the same domain/path/expires/secure parameters. .SS "join" .IX Subsection "join" .Vb 1 \& $cookie = $splitter\->join(@cookies) .Ve .PP This is the inverse of \f(CW\*(C`split\*(C'\fR. .SS "should_split" .IX Subsection "should_split" .Vb 1 \& $splitter\->should_split($cookie) .Ve .PP Whether or not the cookie should be split .SS "mangle_name_next" .IX Subsection "mangle_name_next" .Vb 1 \& $splitter\->mangle_name_next($name) .Ve .SS "mangle_name" .IX Subsection "mangle_name" .Vb 1 \& $splitter\->mangle_name($name, $index) .Ve .SS "demangle_name" .IX Subsection "demangle_name" .Vb 1 \& $splitter\->demangle_name($mangled_name) .Ve .PP These methods encapsulate a name mangling scheme for changing the cookie names to allow a 1:n relationship. .PP The default mangling behavior is not 100% safe because cookies with a safe size are not mangled. .PP As long as your cookie names don't start with the substring \f(CW\*(C`_bigcookie_\*(C'\fR you should be \s-1OK\s0 ;\-) .PP Demangles name, increments the index and remangles. .SH "SUBCLASSING" .IX Header "SUBCLASSING" This module is designed to be easily subclassed... If you need to split cookies using a different criteria then you should look into that. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 CGI::Cookie .IP "\(bu" 4 CGI::Simple::Cookie .IP "\(bu" 4 .IP "\(bu" 4 .IP "\(bu" 4 \&\s-1RFC 2109\s0 .SH "AUTHOR" .IX Header "AUTHOR" יובל קוג'מן (Yuval Kogman) .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" .IP "\(bu" 4 Karen Etheridge .IP "\(bu" 4 Shlomi Fish .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2006 by יובל קוג'מן (Yuval Kogman). .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.