Eric Andreychek > OpenPlugin-0.11 > OpenPlugin::Cookie

Download:
OpenPlugin-0.11.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Module Version: 1.25   Source  

NAME ^

OpenPlugin::Cookie - handler to parse/output cookies from/to the client

SYNOPSIS ^

 # Retrieve the cookies from the client request

 $OP->cookies->get_incoming;

 # Create a new cookie

 $OP->cookies->set_outgoing({
                        name    => 'search_value',
                        expires => '+3M',
                        value   => 'this AND that',
                    });

 # Expire an old cookie

 $OP->cookies->set_outgoing({
                        name    => 'search_value',
                        expires => '-3d',
                        value   => undef,
                     });

 # The cookies are sent to the browser upon sending the HTTP Header

 $OP->httpheader->send_outgoing();

DESCRIPTION ^

This module defines methods for retrieving and creating cookies. You can find information regarding cookies at the following url:

 http://www.ics.uci.edu/pub/ietf/http/rfc2109.txt

METHODS ^

set_outgoing( \%params )

set( \%params )

This method creates a cookie, which will be sent to the browser at the same time the headers are sent. Pass in normal parameters (see below) and the function will create a cookie for you.

Parameters:

get_incoming( [ $cookie_name ] )

get( [ $cookie_name ] )

Called with no parameters, get_incoming() returns a list containing the names of each cookie sent to the server.

Called with one parameter, get_incoming returns a reference to a hash containing the values/parameters for $cookie_name. See get_incoming for a list of the parameters this function returns.

set_incoming( \%params )

Typically called internally by the Cookie driver to tell OpenPlugin about the cookies which we were sent. If for some reason you wish to alter cookie information that has already been sent to the server, you can do so with this function.

See the set_outgoing function for valid parameters for \%params.

TO DO ^

See the TO DO section of the <OpenPlugin::Request> plugin.

BUGS ^

Oddly, expiring of cookies does not seem to work yet.

SEE ALSO ^

See the individual driver documentation for settings and parameters specific to that driver.

COPYRIGHT ^

Copyright (c) 2001-2003 Eric Andreychek. All rights reserved.

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

AUTHORS ^

Eric Andreychek <eric@openthought.net>

syntax highlighting: