Hi everyone, I just want to know, would the following code work for setting a raw array cookie: setrawcookie("userinfo[username]", $username, time()+60*60*24*21, "/", TRUE, TRUE); setrawcookie("userinfo[password]", $password, time()+60*60*24*21, "/", TRUE, TRUE); PHP: and this code for removing it? if (isset($_COOKIE["userinfo"])) { setrawcookie("userinfo[username]", $username, time()-60, "/", TRUE, TRUE); setrawcookie("userinfo[password]", $password, time()-60, "/", TRUE, TRUE); } PHP: Thanks in advance.
Everything looks good. On a side note, unsetting the cookie by calling a past date is correct, but I would use/set a blank value "" instead of the variables you're using.
so like this for setting it setrawcookie("userinfo[username]", $username, time()+60*60*24*21, "/", TRUE, TRUE); setrawcookie("userinfo[password]", $password, time()+60*60*24*21, "/", TRUE, TRUE); PHP: but like this for removing it? if (isset($_COOKIE["userinfo"])) { setrawcookie("userinfo[username]", "", time()-60); setrawcookie("userinfo[password]", "", time()-60); } PHP: