-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 4:16 PM -0400 6/4/01, Joel Gwynn wrote:
>hey all.  I've got a login page which authenticates a user, then 
>needs to set a couple of cookies before redirecting them to a new 
>page.  So, assuming the login was successful, I do this:
>   
>  $cookie1 = $cgireq->cookie(-name=>'sessionID', -value=>$sid, 
>-expires=>'+24h');
>  $cookie2 = $cgireq->cookie(-name=>'customer_id', -value=>$cid, 
>-expires=>'+24h');
>
>print $cgireq->redirect(-cookie=>[$cookie1,$cookie2],
>        -location=>"/cgi-bin/startshopping.pl",
>        -nph=>1 );
>
>The problem is that the cookie appears not to be set, i.e., the 
>'startshopping.pl' script keeps kicking the user back to the login 
>page, as it should if the user was not logged in.
>

This gets discussed on the mod_perl list about once a month. You may 
need to change the order of the directives in the headers. Even then, 
it won't work in all browsers. Using a meta-redirect in the resulting 
web page will work, but of course that won't work for all browsers 
either.  Better yet, just pass the cookie information to the 
following  page and have it set the information.

P.S.  Please don't send messages in HTML format.  You may like your 
text in Arial size 2, but lots of other people may not ("look ma, 
itsy, bitsy font").  And they are the ones who have to read it to 
reply.
- -- 

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBOxv49CZsPfdw+r2CEQLrTwCcDPDCXmMXzLTkLKj8iPALjCduClUAoNt/
0+Ikyib3MEBa/AKFS50v2F0c
=ydl7
-----END PGP SIGNATURE-----

Reply via email to