in reply to Cookies using IP instead of Hostname

Have you tried just using the IP address as the domain:

use CGI; my $query = new CGI; my $cookie = $query->cookie( -name => 'sessionID', -value => 'xyzzy', -expires => '+1d', -path => '/cgi-bin/', -domain => '182.1.1.1' ); print $query->header(-cookie=>$cookie);

This does print the domain as the IP address in the header so will get sent to the browser. *I have no idea whether this will work* but it may and logic suggests that it could/should. It depends on how the browsers work with the domain name. Certainly easy to try. If it works with one browser you best test the others :-)

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: Cookies using IP instead of Hostname
by Anonymous Monk on Jul 22, 2001 at 20:21 UTC
    One clarification: I'm having to do this without using CGI::Cookie, so I just do print "Set-Cookie: blahblahblah" instead. I had tried using just the IP before and it didn't work--in fact, I was having trouble getting any cookie at all to set. I just realized that I was leaving out the "expires" and "path" fields though. Seems to work fine when I put those fields in, even if they're blank. Thanks!