in reply to Re: Removing dot before cookie host/domain URL
in thread Removing dot before cookie host/domain URL

The program seems to use CGI for the cookies (according to the installation module list). However it contains 25 folders, countless files, and a nightmare of global scalars. I haven't yet found the code for the cookie. I thought that it would be easier and more efficient to just overwrite the cookie.

Below is my code which adds the dot before the URL.
#!/usr/bin/perl use CGI; $query = new CGI; $cookie1 = $query->cookie( -domain=>'foobar.com', -name=>'TheCookie', -value=>'anything ', -expires=>'+24h', -path=>'/', -secure=> 0); print $query->header(-cookie=>$cookie1); print"<html> <body> Done. </body> </html>"; print $query->end_html;

Replies are listed 'Best First'.
Re^3: Removing dot before cookie host/domain URL
by ikegami (Patriarch) on Jun 24, 2011 at 20:47 UTC

    Again, I think you are mistaken.

    $ cat > a.pl #!/usr/bin/perl use CGI; $query = new CGI; $cookie1 = $query->cookie( -domain=>'foobar.com', -name=>'TheCookie', -value=>'anything ', -expires=>'+24h', -path=>'/', -secure=> 0); print $query->header(-cookie=>$cookie1); print"<html> <body> Done. </body> </html>"; print $query->end_html; $ perl a.pl Set-Cookie: TheCookie=anything%20; domain=foobar.com; path=/; expires= +Sat, 25-Jun-2011 20:46:56 GMT Date: Fri, 24 Jun 2011 20:46:56 GMT Content-Type: text/html; charset=ISO-8859-1 <html> <body> Done. </body> </html> </body> </html> $

    Upgrade your CGI?

      Hi, I have CGI v3.55 installed.

      I fired up IE and checked the code/cookie there. It seems that the problem with the dot does not occur with IE but with Mozilla based browsers. However, I still can't get a cookie without a dot before the URL in a Mozilla browser.
        There is no problem. You're very confused.
        perl -MCGI -le "print CGI->new->cookie( qw[ -domain example.com -name +key -value val -path / ] )" key=val; domain=example.com; path=/