I am using this code to set a cookie and then see if they exist
setcookie(\"token\", \"value\", time()+60*60*24*100, \"/\"); setcookie(\"secret\", \"value\",
as my testing,we can't use cookies in same time.if you set cookies. you need to reload page to grab those. put like this
if (!isset($_COOKIE['token'])) { setcookie("token", "value", time()+60*60*24*100, "/"); //this set cookies for first time }