HTTP_COOKIE_VARS and HTTP_POST_VARS problem

From: Date: Wed, 04 Oct 2000 14:38:14 +0000
Subject: HTTP_COOKIE_VARS and HTTP_POST_VARS problem
Groups: php.general 
Request: Send a blank email to php-general+get-18587@lists.php.net to get a copy of this message
Hi, I am trying to use cookies but it seems that I don't fully understand them. I have one page : if(isset($HTTP_POST_VARS["nws"])){ while(list($k,$val)=each($HTTP_POST_VARS["nws"])){ setcookie("nws[".$k."]",$val,time()+86400,"/","mydomain.com"); } header("location:customizeNews.php"); } else{ if(isset($HTTP_COOKIE_VARS["nws"])){ //show html with the listboxes on the current selection }else{ //show html } } This page should show me a series of listboxes with options and it does so. After I make my options the page is submited ($PHP_SELF) and this time I should have the same page with the same listboxes but with the options selected. This options are stored in a cookie. Well the problem is that if I make my options, submit the page and then I try to change one or more options and resubmit the page I have the old options. The cookies are not updated. Anyone has any ideea? I'm using IE 5.0, but on Netscape 4.7 it does the same thing. Thanx, Ovidiu

« previous php.general (#18587) next »