kool_samule Posted May 14, 2010 Share Posted May 14, 2010 Hi Chaps, I'm having trouble setting a cookie. The login.php file is in a directory called 'account' The cookie name in Termporary Internet Files shows as: 'account/' instead of the standard 'cookie:[email protected]'. This results in the cookie being read by files with the 'account' directory. I've searched around played around the the $path and $domain variables, but they don't seem to do anything. Although the PHP code looks like this: setcookie($name, $value, $hour); The cookie looks like this: $name, $value, $path, $time Can someone tell me where I'm going wrong with this? Link to comment https://forums.phpfreaks.com/topic/201797-basic-cookie-question/ Share on other sites More sharing options...
ignace Posted May 15, 2010 Share Posted May 15, 2010 Why do you want a separate cookie in the /account/ section? Why not just use: $_SESSION['account'] for the /account/ section and $_SESSION[..] for whatever other section? Link to comment https://forums.phpfreaks.com/topic/201797-basic-cookie-question/#findComment-1058624 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.