This seems to be a fairly common question on the mailing list.

The reason that this happens is because PHP doesn't read the cookie from
the users machine until the next reload. This can be solved with
JavaScript.

I would highly suggest that you drop cookies and look into sessions:

- super easy to learn
- they're much easier to deal with
- you don't have to maintain them
- More secure, since they are stored on the server

you can skip cookies completely for most applications. Which means you
can reach a larger audience.

http://www.php.net/manual/en/ref.session.php


> -----Original Message-----
> From: Stanley [mailto:[EMAIL PROTECTED]]
> Sent: October 17, 2001 12:42 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] setcookie
> 
> Hi,
> 
> thanks for your help!
> do you have the problem with IE (ver4 above)?
> i tried and cookie didn't capture by IE, but netscape can..
> any advise. thx!
> 
> actually, i use setcookie in page1.php and will show the value in
> page2.php... for authentication
> 
> pls help... thx a lot!
> 
> Stanley
> 
> 
> "Robin Bolton" <[EMAIL PROTECTED]> wrote in message
> 005101c156d5$0a94c7f0$a60f6c18@razero">news:005101c156d5$0a94c7f0$a60f6c18@razero...
> > The problem is the second parameter has to be in double quotes.
> >
> > setcookie("TestCookie","$value",time()+3600);
> >
> > should fix the problem (tested and worked on mine).
> >
> > > -----Original Message-----
> > > From: Stanley [mailto:[EMAIL PROTECTED]]
> > > Sent: October 16, 2001 9:36 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP-WIN] setcookie
> > >
> > > Hi,
> > >
> > > can anyone tell me what's the correct procedure for setcookie..
> > > i already tried : setcookie ("TestCookie", $value,time()+3600);
> > > but it can't work...
> > >
> > > actually, i need to make the authentication page and the page
should
> > have
> > > expiry function...
> > >
> > > pls help!.. thx!
> > >
> > > Stanley
> > >
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> >
> >
> 
> 
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to