setcookie() won't set the cookie

This is a discussion on setcookie() won't set the cookie within the PHP General forums, part of the PHP Programming Forums category; Hi all! This is really driving me crazy but i cannot figure out why a simple php script won't ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-03-2003
droog
 
Posts: n/a
Default setcookie() won't set the cookie

Hi all!
This is really driving me crazy but i cannot figure out why a simple
php script won't set a cookie on my machine, but works just fine on my
girlfriends machine.

The first script setcookie.php is:

<?
$value = 'test';
setcookie ("testCookie", $value, time()+3600);
header("Location: showcookie.php");
?>

and the other script getcookie.php is:

<?
if (isset($_COOKIE['testCookie']))
{print $_COOKIE['testCookie'];}
else
{print "cookie 'testCookie' is not set";}
?>

it just always gives me a "cookie 'testCookie' is not set" all the
time.
My privacy setting in IE6 is set to the lowest "Accept All Cookies"
and i had no luck in Netscape or Opera either.
I'm running Windows XP, Apache 2, PHP 4.3.2 and my girlfriend's
machine runs the same, I even replaced my php.ini with hers, but it
still won't help.
I tried to use header("Set-cookie:testCookie=$value") instead of
setcookie() or $HTTP_COOKIE_VARS instead of $_COOKIE, but still no
luck.
I finally reinstalled PHP and Apache, but still cannot make it work.
I just ran out of ideas what else I can do to make it work on my
machine.

Anyone got a clue on this?

Thank you.
Reply With Quote
  #2 (permalink)  
Old 11-03-2003
droog
 
Posts: n/a
Default Re: setcookie() won't set the cookie

I figured out what was the problem.

It was my ZoneAlarm Pro 3.7.159. Even though its privacy setting
'Cookie control' was set to off, I moved the slider up and down just
to make sure it was off and also reset the ad blocking setting from
medium to Off and bingo! my cookie setting script was working.

So stupid. I went through so much trouble to realise it was
ZoneAlarm's bug. I better get an update.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:49 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0