How to Create, Read, Update and Delete a Cookie with PHP or JavasScript

A cookie, also known as an HTTP cookie, web cookie, or browser cookie, is a small piece of data sent from a website to the local system and stored in a user’s web browser while the user is navigating that website.

Every time the user view the website, the browser sends the cookie back to the server to notify the website of the user’s previous activity. Cookies were designed to be a reliable mechanism for websites to remember stateful information (such as items in a shopping cart) or to record the user’s browsing activity.

You can set the time for cookie stored in user’s browser.