[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Using CGI::Cookie from inside CGI::Application


Hello!

1. Replace '+1H' with '+1h'
2. Are you using https connection? You need to, if you are using
'secure' cookie.

You can see which headers are sent with 'Live HTTP headers' extension
for Firefox.

As for retrieving cookie values, look at CGI.pm documentation: "To
retrieve a cookie, request it by name by calling cookie() method
without the -value parameter". Use  my $value=$q->cookie('some_name'
);

2008/5/21 CGI User <suppressed>:
> I'm trying to use CGI::Cookie module calling it from CGI::Application
> environment in cgiapp_prerun like this:
>
> sub cgiapp_prerun {
>    my $self = shift;
>
>    my $cookie = CGI::Cookie->new(
>        -name       => 'some_name',
>        -value      => '12345',
>        -domain     => '.come_domain.com',
>        -path       => '/',
>        -expires    => '+1H',
>        -secure     => 1,
>    );
>
>    $self->header_add(-cookie => [$cookie]);
>
>    return $self;
> }
>
> But nothing is happening, and this test cookie is not being set in the
> browser (Firefox).

> My question are:
> 1. Why it didn't work in the first case.
> 2. If the first case won't work, then how I can set all the cookie
> parameters
> e.g. domain, path, expires, secure using the second case.
> 3. How I can retrieve my cookie from the browser is the recommended first
> case to set cookie is not working, and the second case is working but I
> cannot see any method to retrieve my own cookie?

-- 
Alexandr Ciornii, http://chorny.net

#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.