Hi,
I'm currently working on a perl script which needs to store cookies to retain user preferences. For some reason, I can't get it to work (not fully at least).
Can you please give me some hints bcs I cant see the problem anymore.
Here's my code:
Code:
#!/usr/bin/perl
use strict;
use warning;
use CGI::Carp qw(fatalsToBrowser);
use CGI;
use CGI::Cookie;
my $Cgi = new CGI;
my $Cookie = CGI::Cookie->new(
-name => 'test',
-value => 'abc',
-expires => '+2d'
);
print $Cgi->header(-cookie => $Cookie);
print $Cgi->start_html('test');
print $Cgi->end_html();
So here are my test results:
Elinks (text web browser under debian): OK
Internet explorer 8: NOK
Firefox: NOK
Sniffing the actual response traffic to IE8/Firefox with wireshark shows the cookie but it is not taken into account. Changed the security settings on both web browser to almost none but still not accepted....
I played around with all kinds of cookie settings but it doesn't work. The only thing I still thought was that I'm currently working with a fake test domain name which is in the localhost file (I use vmware / apache / mod_perl with virtual hosting). So there's "www.websitea.be" in my hosts file (both on server and client). so I tried to change the domain name to something official like yahoo.com but it doesnt work.
I also use NTP to sync date & time so that there can't be any problem with the expiration of the cookies...
I'm almost desperate. wasted some hours on this already
Thx for you help
Regards
J.