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")
PHP
Topic: Cookies
How To Set a Persistent Cookie?
Browse random answers:
How To Send a Cookie to the Browser?
How To Test Cookies on a Web Server?
How To Set a Persistent Cookie?
How To Test Persistent Cookies?
What Are Domain and Path Attributes for Cookies?
How To Specify Domain and Path for a Cookie?
What Is the Common Mistake When Setting Path and Domain on Temporary Cookies?
How Cookies Are Transported from Servers to Browsers?
How To View Cookie Header Lines?
How Cookies Are Transported from Browsers to Servers?
Where Are the Persistent Cookies Stored on Your Computer?
How To Delete Cookie Files on Your Computer?
How Many Cookies Can You Set?
What is a Cookie?
How to Create a Cookie?
What is syntax of setcookie?
How to Retrieve a Cookie Value?
How to Delete a Cookie?
What is the meaning of a Persistent Cookie?
What does $_COOKIE means?