in reply to Re^2: CGI Cookie Inconsistencies
in thread CGI Cookie Inconsistencies

./ is likely only be the same directory as the script and not the script's URI so your suggestion is broken (not absolute) and likely to be wrong since most folks don't setup their CGIs to dispatch to "directory" names. :)

Replies are listed 'Best First'.
Re^4: CGI Cookie Inconsistencies
by Anonymous Monk on Nov 08, 2009 at 10:42 UTC
    I don't think so.

      And we were just discussing Dunning–Kruger the other day...

      use strict; use warnings; use CGI::Pretty (); use URI (); my $cgi = CGI::Pretty->new(); print $cgi->header(), $cgi->start_html(), $cgi->h3("CAN I HAZ PURL?"), $cgi->h4("YUR DOIN IT RONG"), $cgi->blockquote( yours($cgi) ), $cgi->h4("YUR DOIN IT... PRETY GUD AKSHULY"), $cgi->blockquote( mine($cgi) ), $cgi->end_html(); exit 0; sub yours { my $cgi = shift; $cgi->url(-relative=>1) . '?a='; } sub mine { my $cgi = shift; my $uri = URI->new( $cgi->url ); ( my $path = $uri->path ) =~ s![^/]+\z!!; $uri->path( $path || "/" ); $uri->query_form( a => undef ); $uri; }

      CAN I HAZ PURL?

      YUR DOIN IT RONG

      pm-805175.cgi?a=

      YUR DOIN IT... PRETY GUD AKSHULY

      http://localhost/cgi/?a=