GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CGI::COOKIE::SPLITTER (3)

.ds Aq ’

NAME

CGI::Cookie::Splitter - Split big cookies into smaller ones.

CONTENTS

VERSION

version 0.05

SYNOPSIS



    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 );



DESCRIPTION

RFC 2109 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.

This module provides a pretty simple interface to generate small cookies that are under a certain limit, without wasting too much effort.

METHODS

    new



    $splitter = CGI::Cookie::Splitter->new(%params)



The only supported parameters right now are size. It defaults to 4096.

    split



    @cookies = $splitter->split(@cookies)



This method accepts a list of CGI::Cookie objects (or lookalikes) and returns a list of CGI::Cookies.

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.

    join



    $cookie = $splitter->join(@cookies)



This is the inverse of split.

    should_split



    $splitter->should_split($cookie)



Whether or not the cookie should be split

    mangle_name_next



    $splitter->mangle_name_next($name)



    mangle_name



    $splitter->mangle_name($name, $index)



    demangle_name



    $splitter->demangle_name($mangled_name)



These methods encapsulate a name mangling scheme for changing the cookie names to allow a 1:n relationship.

The default mangling behavior is not 100% safe because cookies with a safe size are not mangled.

As long as your cookie names don’t start with the substring _bigcookie_ you should be OK ;-)

Demangles name, increments the index and remangles.

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.

SEE ALSO

o CGI::Cookie
o CGI::Simple::Cookie
o <http://www.cookiecutter.com/>
o <http://perlcabal.org/~gaal/metapatch/images/copper-moose-cutter.jpg>
o RFC 2109 <https://www.ietf.org/rfc/rfc2109.txt>

AUTHOR

XXXX XXXXX (Yuval Kogman) <nothingmuch@woobling.org>

CONTRIBUTORS

o Karen Etheridge <ether@cpan.org>
o Shlomi Fish <shlomif@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2006 by XXXX XXXXX (Yuval Kogman).

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CGI::COOKIE::SPLITTER (3) 2015-08-16

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.