I am writing several cookies to disc and then displaying a page imediately after they are written that displays user information. My problem is that the initial page display shows no user info, but when I refresh the page, they are there. It's as if the cookies where being written very slowly. Here is the code in question:
$userView = unserialize($_SESSION['userView']);
$_SESSION['userView'] = null;
setcookie('windstorm', 'WINDSTORM_USER12f8jGlKQa7bi2LcX4zDi', LOGIN_EXP_TIME, "/");
setcookie('userName', $userView->getFirstName(), LOGIN_EXP_TIME, "/");
setcookie('secDesc', $userView->getSecDesc(), LOGIN_EXP_TIME, "/");
setcookie('secLevel', $userView->getSecLevel(), LOGIN_EXP_TIME, "/");
setcookie('userId', $userView->getId(), LOGIN_EXP_TIME, "/");
$smarty = new Smarty();
//add messages like these to a constants file (page titles etc)
$smarty->assign('message', 'Welcome to Windstorm');
$smarty->display('default.tpl.html');
Any have any suggestions?