How to create a cookie system on a website using PHP

Cookies are a system that can store certain data that is calculated based on time. Cookies are found on every website in the browser and are used for storage.
Saving not only logins but also text can be saved properly. A suitable structure for the Internet. In PHP language there are 2 ways to save in almost the same way and with almost the same shortcomings, namely: meeting and Cookies.
meeting can save certain data easily, but cannot save for a long time because the time function is not used for long storage. and Cookies can be used to save data after the specified time, but saving is not as simple as a session. So you have to call it up again and define the path so that the data can be stored in a specific folder.
The above two systems have their own advantages and disadvantages, and from a storage perspective, cookies are the best. So let’s discuss creating cookies on websites using PHP.
The original structure of the cookie creation is as follows
And it can be minimized by removing the path and domain attributes, for example it looks like this:
The above cookie lasts 3600 seconds. And the result is 1 hour to the minute. Then you can call the cookie name directly from the $ _COOKIE function, for example like this:
Cookies can also be deleted simply by changing the plus (+) times to minus (-):
Sometimes the storage of cookies on other sites cannot be stored on ROOT either. So use the path and domain attributes as follows:
The Path attribute function saves ROOT and .domain.url can be replaced by the URL of their respective websites, as long as you do not delete the period at the beginning of the domain, because the subdomain can also save cookie data with this.
The cookie call function as above can be combined with other attributes such as otherwise and other. And I have also prepared an example of using cookies along with a pre-made form. Please download dipejari in and below!
Is there anything that doesn’t understand above ..? Please comment
Hopefully useful and good luck