[thelist] Why cookies does not sets

Mas Ajar Laliyuswa wihartoyo at telkom.net
Wed Feb 13 20:44:01 CST 2002


I just got the answer by myself.  It does not work because of httpd.conf of
Apache configurations.

----- Original Message -----
From: "Andrew Forsberg" <andrew at thepander.co.nz>
To: <thelist at lists.evolt.org>
Sent: Thursday, February 14, 2002 9:00 AM
Subject: Re: [thelist] Why cookies does not sets


> >hello people
> >I'm using PHP4 (for win) and Apache 1.3 (for win) with IE 5 browser.
> >I'm using setcookie() php function to set cookie variables, but it
> >is not work correctly. When I user $HTTP_COOKIE_VARS[] to get
> >variable, but  I still get nothing, even if I use security set (on
> >Internet Option) to low.
> >Why?
>
> Hi
>
> Can you show us the bit of code you're using to set the cookie, and a
> snippet from where you're trying to read it?
>
> Save something like this as testing_cookies.php on your server:
>
> <?php
> $test_var = "howdy doody";
> setcookie("test_var", $test_var);
> print ("<html><pre>");
> print_r ($HTTP_COOKIE_VARS);
> print ("</pre></html>");
> ?>
>
> The first time you load the page it will print:
>
> Array
> (
> )
>
> On refreshing the page you should see:
>
> Array
> (
>      [test_var] => howdy doody
> )
>
> This is because a cookie isn't accessible from the browser at the
> time it is set. Have a look over the php cookie docs at:
>
> http://www.php.net/manual/en/features.cookies.php
>
> HTH
> Andrew
>
> --
> Andrew Forsberg
> ---
> uberNET - http://uber.net.nz/
> the pander - http://thepander.co.nz/
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !
>




More information about the thelist mailing list