Gossamer Forum
Home : General : Perl Programming :

set cookie locally

Quote Reply
set cookie locally
I have Xitami set up on my system so I can work on stuff offline, ip 127.0.0.1.
I'm having trouble setting a cookie on my local drive.
I'm using standard cookie code -

use CGI qw/:standard/;
use CGI::Cookie;
$c = new CGI::Cookie(-name => 'vanila',
-value => 'cream',
-expires => '+3M',
-domain => '.127.0.0.1',
-path => '/cgi-bin'
);
print header(-cookie=>$c);

but it dosn't work.
Any one had any success doing this.

Bob
http://totallyfreeads.com
Quote Reply
Re: [lanerj] set cookie locally In reply to
I remember having problems doing this. I can't remember if I had problems setting them when I was using http://localhost/ or http://my.ip.address./ - I think i had to use an IP actually to get it working. I think that 127.0.0.1 is the localhost ip... use the one that your ISP assigns you, 203.55.23.523 etc instead of the localhost one...
Cheers,
Michael Bray
Quote Reply
Re: [lanerj] set cookie locally In reply to
You can use -domain => '',


Your loopback address is 127.0.0.1 ....

The . you have before the 1 may cause problems as you only need that for domains not IP's.
Quote Reply
Re: [Paul] set cookie locally In reply to
Thanks guys,
taking the . out of -domain => '127.0.0.1 ' works in mie at least, dosn't work with netscape 4.7 though, but I can live with that for the time being.

Bob
http://totallyfreeads.com
Quote Reply
Re: [lanerj] set cookie locally In reply to
Try just:

-domain => '',
Quote Reply
Re: [Paul] set cookie locally In reply to
using -domain => '', dosn't work in netscape 4.7, works fine in mie. I carn't read a cookie with netscape either. I havn't tried this online so it may be ok then, or it just might be netscape 4.7.
Havn't tried it in any other versions of netscape yet.

Bob
http://totallyfreeads.com