Setting and Reading a Cookie in PHP

This code would create a cookie name myCookie with the value of “theValue”. To retrieve the value of that cookie, one may create a variable to retrieve the value of that cookie. For example:

//read cookie info
$cookie1=$_COOKIE[“myCookie”];
Variable %cookie1 will provide the value of “theValue”.

Leave a Reply

Your email address will not be published. Required fields are marked *