You are here: Re: $_COOKIE variable is always empty « All PHP « IT news, forums, messages
Re: $_COOKIE variable is always empty

Posted by Rik on 03/03/07 23:39

Seansan <sean115=3Dat@=3Dreeve.nl> wrote:
>>> When I run the following in PHP then two cookies are set.
>>>
>>> ini_set('session.name', 'session-1');
>>> session_start();
>>> setcookie('session-2', '');
>>>
>>> Both cookies are being sent to the client, and then to the server (I=
am
>>> sure), but they are not available in $_COOKIE (this array is empty).=

>Thank you for your answer. setcookie() has been called correctly and =

> with all the arguments. (this was just a simple example).
>
> The cookies are stored on the client, and also sent to the server. I =

> have tested with firefox and IE. There is something happening serversi=
de =

> that either changes the COOKIE value, doesnt allow it to be set, of ha=
s =

> another hash where it is stored.

First of all, just to make sure, you do know that it will only be in the=
=

$_COOKIE array on a second or later request?

Secondly, I'd like to know how you are so sure the cookie is sent back. =
=

How did you check that? (FF->LiveHTTPHeaders, MSIE->Fiddler ?)

On Apache, you can check what request headers make it to the script with=
=

apache_request_headers(), is the cookie header there?
-- =

Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация