Barry King

NAME

Apache::Wyrd::Cookie - Consistency wrapper for Apache::Cookie and CGI::Cookie

SYNOPSIS

        use Apache::Wyrd::Cookie;
        #$req is Apache request object
        my $cookie = Apache::Wyrd::Cookie->new(
                $req,
                -name=>'check_cookie',
                -value=>'checking',
                -domain=>$req->hostname,
                -path=>($auth_path || '/')
        );
        $cookie->bake;

        my %cookie = Apache::Wyrd::Cookie->fetch;
        my $g_value = $cookie{'gingerbread'};

DESCRIPTION

Wrapper for Apache::Cookie or CGI:Cookie cookies. This class is provided for no other reason than to make the new and bake methods consistent in their requirements between these modules, which they are not normally. Otherwise, Apache::Wyrd::Cookie behaves entirely like Apache::Cookie or CGI::Cookie depending on which is installed and takes the same arguments to its methods. Please refer to the documentation for those modules.

The normal behavior is to favor Apache::Cookie. If it is not installed, it will attempt to use CGI. Failing both, it will call die(), causing a server error. You can force the use of Apache::Cookie or CGI::Cookie by setting the WYRD_USE_CGI or WYRD_USE_APR environment variables. If the forced module fails to load, the module will die(), causing a server error. Note that using these environement variables also affects the behavior of Apache::Wyrd::Cookie.

BUGS/CAVEATS/RESERVED METHODS

UNKNOWN

AUTHOR

Barry King <wyrd@nospam.wyrdwright.com>

SEE ALSO

Apache::Wyrd

General-purpose HTML-embeddable perl object

Apache::Cookie

Cookies under Apache

LICENSE

Copyright 2002-2007 Wyrdwright, Inc. and licensed under the GNU GPL.

See LICENSE under the documentation for Apache::Wyrd.