Hello,
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 =
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
Hi Sasha,
Thanks for the hints.
However, even if I replace '+1H' with '+1h' and don't set secure flag
the cookie still doesn't show up in the browser.
Do you have any other ideas?
Thanks in advance,
Alex
Alexandr Ciornii wrote:
Hello!
1. Replace '+1H' with '+1h'
2. Are you using https
Hello.
1. Try removing
-domain = '.come_domain.com',
in addition to other changes.
2. Try removing all except '-name', '-value', '-expires' parameters.
and make expires bigger like '+20h'.
2008/5/21 CGI User [EMAIL PROTECTED]:
Hi Sasha,
Thanks for the hints.
However, even if I
CGI User wrote:
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
Thank you,
I got it.
If I form cookie like this:
my $cookie = $q-cookie( -name=$cook_name, -value=$sess_id,
-expires=$cook_exp);
$self-header_add(-cookie = $cookie);
Everything works honky dory.
But if I form cookie like this:
my $cookie = $q-cookie( -name=$cook_name, -value=$sess_id,
CGI User wrote:
But if I form cookie like this:
my $cookie = $q-cookie( -name=$cook_name, -value=$sess_id,
-expires=$cook_exp, -domain='.'.$domain, -path='/');
It doesn't work at all.
What is the domain you are using to access this? If it's www.domain.tld then
you're good. But if it's just