Aack!  Once again sent to the posted instead of the group.  Sigh...
__________________________________

Are you perchance using IIS?  IIS has a known bug in version 3, 4, and 5 (yup, that's 3
versions!), where it ignores the Set-Cookie: header when combined with a Location: 
header.

You can find a Microsoft statement regarding this at
http://support.microsoft.com/support/kb/articles/Q176/1/13.ASP

In this case, I think your code may be at fault. Set the cookie when printing the 
redirect header.
 Here's one way to set a cookie with a redirect header:

#!C:\perl\bin\perl.exe
use CGI;
my $cgi = CGI->new;
my @cookieOut;
push @cookieOut, ($cgi->cookie( -name    => 'id',
                                -value   => "something",
                                -expires => '+7d',
                                -path    => '/'));

print $cgi->redirect( -cookie   => \@cookieOut,
                      -location => 'http://www.somehost.com' );

--- Mark Mogridge <[EMAIL PROTECTED]> wrote:
> Ooops Iıll try again...with a header this time.
> 
> 
> Hi there!
> 
> Redirecting AND creating cookies - I can't!
> 
> I can create cookies...
> print header(-cookie=>[$clubid,$membername,$pointsbal]);
> Thatıs fine
> 
> 
> 
> I can redirect...  
> print "Location: $gotourl";
>                    
> OR
>                    
> print redirect("$gotourl");
> Thatıs fine ­ 
> 
> but NOT if I create cookies first.  The location gets sent to the browser
> window instead.
> Some documentation has vaguely mentioned that I may have my header in the
> wrong place.
> Should I Œcloseı/ıendı the first (cookies) print header before continuing?
> 
> 
> I tried putting the two together as in ...
> print header(-cookie=>[$clubid,$membername,$pointsbal] ,
> redirect($gotourl));
> It almost worked ­ but the url came out in CAPS so it wasnıt recognised by
> the browser.
> 
> 
> Maybe Iım too tired to see it ­ but I just canıt!
> 
> Yours, Mark. 
> 
> 
> 


=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to