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

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -