GX::HTTP::Response::Cookie - HTTP response cookie class
# Load the class use GX::HTTP::Response::Cookie; # Create a new cookie object $cookie = GX::HTTP::Response::Cookie->new( name => 'Customer', value => 'Wile E. Coyote', path => '/acme' ) # Parse a "Set-Cookie" header @cookies = GX::HTTP::Response::Cookie->parse( 'Customer="Wile E. Coyote"; Path="/acme"; Version="1"' );
This module provides the GX::HTTP::Response::Cookie class which extends the GX::HTTP::Cookie class.
new
Returns a new GX::HTTP::Response::Cookie object.
$cookie = GX::HTTP::Response::Cookie->new( %attributes );
comment ( string )
comment
comment_url ( string )
comment_url
discard ( bool )
discard
domain ( string )
domain
expires ( string )
expires
The given value must be in the "Wdy, DD-Mon-YYYY HH:MM:SS GMT" format.
http_only ( bool )
http_only
max_age ( string )
max_age
name ( string )
name
path ( string )
path
port ( string )
port
secure ( bool )
secure
value ( string )
value
version ( string )
version
$cookie ( GX::HTTP::Response::Cookie object )
$cookie
GX::Exception
Also see parse().
parse()
as_string
Returns a string representation of the cookie, suitable for inclusion in a "Set-Cookie" or "Set-Cookie2" header.
$string = $cookie->as_string;
$string ( string )
$string
Returns / sets the value of the cookie's "Comment" attribute.
$comment = $cookie->comment; $comment = $cookie->comment( $comment );
$comment ( string | undef ) [ optional ]
$comment
undef
$comment ( string | undef )
Returns / sets the value of the cookie's "CommentURL" attribute.
$comment_url = $cookie->comment_url; $comment_url = $cookie->comment_url( $comment_url );
$comment_url ( string | undef ) [ optional ]
$comment_url
$comment_url ( string | undef )
Returns / sets the cookie's "Discard" flag.
$bool = $cookie->discard; $bool = $cookie->discard( $bool );
$bool ( bool ) [ optional ]
$bool
$bool ( bool )
See GX::HTTP::Cookie.
Returns / sets the value of the cookie's "Expires" attribute.
$expires = $cookie->expires; $expires = $cookie->expires( $expires );
$expires ( string | undef ) [ optional ]
$expires
$expires ( string | undef )
Returns / sets the cookie's "HttpOnly" flag.
$bool = $cookie->http_only; $bool = $cookie->http_only( $bool );
Returns / sets the value of the cookie's "Max-Age" attribute.
$max_age = $cookie->max_age; $max_age = $cookie->max_age( $max_age );
$max_age ( string | undef ) [ optional ]
$max_age
$max_age ( string | undef )
parse
Parses the value of a "Set-Cookie" (or "Set-Cookie2") header into a list of GX::HTTP::Response::Cookie objects.
@cookies = GX::HTTP::Response::Cookie->parse( $string );
@cookies ( GX::HTTP::Response::Cookie objects )
@cookies
Returns / sets the cookie's "Secure" flag.
$bool = $cookie->secure; $bool = $cookie->secure( $bool );
RFC 2109
RFC 2965
Jörg A. Uzarek <uzarek@runlevelnull.de>
Copyright (c) 2009-2011 Jörg A. Uzarek.
This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.
To install GX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GX
CPAN shell
perl -MCPAN -e shell install GX
For more information on module installation, please visit the detailed CPAN module installation guide.