Re: cookie problem. Not possible to set and read a cookie on the same page?
| From: | Julio Nobrega Trabalhando | Date: | Tue, 26 Mar 2002 16:49:01 +0000 |
| Subject: | Re: cookie problem. Not possible to set and read a cookie on the same page? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90218@lists.php.net to get a copy of this message | ||
Not possible, read the manual page about setcookie:
www.php.net/setcookie
There's a 'common pitfall' entry saying so.
Don't know why. Maybe the cookie is only written to user's disk after the
page is fully loaded, maybe for security reasons.
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
"Andy" <news.letters@gmx.de> wrote in message
news:20020326163801.7493.qmail@pb1.pair.com...
> Hi there,
>
> I am wondering if it is possible to send a cookie and read it on the same
> page.
>
> Following environment:
>
> There is a cookie already on the machine of the client, but expired.
> Now I am setting a new cookie and reading it on the same page via $sess_id
=
> $HTTP_COOKIE_VARS[$sesscookiename];
>
> Unfortuanaelly it gives me the old session id back. After refreshing I am
> getting the new sessid and everything works fine. The cookie has been sent
> with the right value, I did dubble check it. But the HTTP_C... reads the
old
> one.
>
> why? Thanx for any help,
>
> Andy
>
>
>
>