In your code, it appears you are attempting to determine the value of the cookie immediately upon setting. The value of the cookie is NOT available at this point; a new page must be opened.
Why are you setting time to 0? If you want cookie to disappear at end of the session, use NULL. Are you certain that $_COOKIE[] is available to you? have you tried $HTTP_COOKIE_VARS[]? Your code ends with two braces ( } ); why? It should end with a single brace. ----- Original Message ----- From: "Joshua Chapman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 12:57 PM Subject: [PHP] problems with cookies and PHP This is driving me nuts... it won't set or reset the cookie no errors no nothing... I've learned quite a bit about cookies and PHP thus far but something important must still be eluding me. I've read the manual entry on it, is there any other tutorial out there that's better? what am I doing wrong? <?php if(!isset($_COOKIE['userInfo'])){ setcookie("userInfo","temp",0,"/","faxonautoliterature.com",0); print "set temp"; }else{ if($_COOKIE['userInfo']=="temp"){ setcookie("userInfo","userID",time()+60*60*24*30,"/","faxonautoliterature.com",0); print "set info"; } } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php