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, ∼2905🔥, 0💬
Popular Posts:
How To Remove Slashes on Submitted Input Values in PHP? By default, when input values are submitted ...
Where to find tutorials on PHP language? I want to know how to learn PHP. Here is a large collection...
How To Use an Array as a Queue in PHP? A queue is a simple data structure that manages data elements...
How to add an API to an API product for internal testing on the Publisher Portal of an Azure API Man...
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard i...