How we add a cookie value to an existing cookie in php -
this code not getting cookie value in page
if (isset($_cookie['mycookie'])) { $cookie[] = $proid; $cookie = implode(',', $cookie); $cookie = unserialize($cookie); setcookie('mycookie', serialize($cookie), time() + (86400 * 30), '/'); }
you doing isset($_cookie['mycookie'])
check if $_cookie['mycookie']
set or not, return true
if set else false
. , if setting inside if
block first time never set. should -
if(!isset($_cookie['mycookie'])) // set cookie }
Comments
Post a Comment