Roland Corbet wrote:
> 
> At 19:19 20/09/2000, Dave Dunstan wrote:
> >OH! Sweet. Thanks again Bill. You are becoming my personal Perl hero ...
> 
> I'm guessing that means it worked? ;-)  I have tried the following, but it
> produces the following output:
> 
> Status: 302 Moved Set-Cookie: Test=Test%20Data; path=/scripts; expires=Tue,
> 20-Feb-2001 11:24:40 GMT Date: Wed, 22 Nov 2000 11:24:40 GMT Location:
> http://www.psyche.net.uk

Where are the CR/LFs in the above?  There should be 4 lines there, not one.
Maybe you put out a header prior to the code below???

> here's what I used to get that output:
> 
> use CGI;
> use CGI::Cookie;
> $query = new CGI;
> 
> $NAME = "Test";
> $EXPIRY = "+3M";
> $VALUE = "Test Data";
> $PATH = "/scripts";
> $URL = "http://www.psyche.net.uk";
> 
> $c = new CGI::Cookie(-name    =>  "$NAME",
>                  -expires =>  "$EXPIRY",
>                  -value   =>  "$VALUE",
>                  -path    =>  "$PATH"
> );
> 
> print $query->redirect(-uri=>"$URL", -cookie => ["$c"]);
> 
> if I just do:
> 
> print $query->redirect(-uri=>"$URL");
> 
> on it's own, then it works fine.  It just stops as soon as I add on the
> Cookie part.  Any ideas why it doesn't work, or what is going on?

Worked fine for me:

use strict;
use CGI;
use CGI::Cookie;

my $NAME = "Test";
my $EXPIRY = "+3M";
my $VALUE = "Test Data";
my $PATH = "/scripts";
my $URL = "http://www.psyche.net.uk";

my $c = new CGI::Cookie(-name => $NAME, -expires => $EXPIRY, -value => $VALUE, 
  -path => $PATH);

my $query = new CGI;
print $query->redirect(-uri => $URL, -cookie => [$c]);
#print $query->redirect(-uri => $URL);
exit 0;

>From commandline it generated (first wo cookie second w):

(offline mode: enter name=value pairs on standard input)
Status: 302 Moved
Location: http://www.psyche.net.uk


(offline mode: enter name=value pairs on standard input)
Status: 302 Moved
Set-Cookie: Test=Test%20Data; path=/scripts; expires=Tue, 20-Feb-2001 12:11:24 GMT
Date: Wed, 22 Nov 2000 12:11:24 GMT
Location: http://www.psyche.net.uk

Apache 1.3.14/Win98SE/Perl 522
-- 
  ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
 (_/   /  )    // //       DBE Collectibles   http://www.wgn.net/~dbe/
  / ) /--<  o // //      Mailto:[EMAIL PROTECTED]   http://dbecoll.webjump.com/
-/-' /___/_<_</_</_    http://www.freeyellow.com/members/dbecoll/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to