Tools, FAQ, Tutorials:
Setting a Persistent Cookie in PHP
How To Set a Persistent Cookie in PHP?
✍: FYIcenter.com
If you want to set a persistent cookie, you can use the setcookie() function with an extra parameter to specify its expiration time. To follow sample script sets 2 persistent cookies to be expired within 7 days:
setcookie("LoginName","FYICenter");
setcookie("PreferredColor","Blue");
setcookie("CouponNumber","07470433",time()+60*60*24*7);
setcookie("CouponValue","100.00",time()+60*60*24*7);
print("2 temporary cookies were delivered.\n");
print("2 consistent cookies were delivered.\n");
⇒ Testing Persistent Cookies in PHP
⇐ What Is a Persistent Cookie in PHP
2016-11-04, ∼3277🔥, 0💬
Popular Posts:
How to dump (or encode, serialize) a Python object into a JSON string using json.dumps()? The json.d...
How to attach console to a Running Container using the "docker container exec" command? I want to ge...
Can You Add Values to an Array without Keys in PHP? Can You Add Values to an Array with a Key? The a...
How to install "C++/CLI Support" component in Visual Studio? I need to build my Visual Studio C++/CL...
How to validate the id_token signature received from Azure AD v2.0 authentication response? You can ...