note 46758 added to function.setcookie

From: Date: Fri, 22 Oct 2004 09:35:29 +0000
Subject: note 46758 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-78934@lists.php.net to get a copy of this message
Need help.. I am creating cookies in php, which works fine in Mozilla in the same session[window], for example I can create them and then reload the page and see the results take effect. But in Internet Explorer I create the cookies, but have to close the browser window/session and reopen the browser for the cookies to be read/take effect. Here is my code. if ((isset($_POST['cookieCollege'])) && (isset($_POST['cookieFolder']))) { setcookie("default_college", "$cookieCollege", time()+60*60*24*360, "/", ".mycollegepost.com"); setcookie("default_folder", "$cookieFolder", time()+60*60*24*360, "/", ".mycollegepost.com"); } Then I have: if(($_COOKIE['default_college']) && ($_COOKIE['default_folder'])) { $collegeName = $_COOKIE[default_college]; $folder = $_COOKIE[default_folder]; echo "<meta HTTP-EQUIV=\"refresh\" CONTENT=\"0; URL=http://www.mycollegepost.com/{$folder}/\">"; } Thanks for any help! ---- Manual Page -- http://www.php.net/manual/en/function.setcookie.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+46758 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46758&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46758&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46758&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46758&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46758&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46758&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+46758&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#78934) next »