PHP (Hypertext Preprocessor) : 01/06/2025 1 Prepared By: Mr. Dereje A
PHP (Hypertext Preprocessor) : 01/06/2025 1 Prepared By: Mr. Dereje A
CHAPTER 5
<?php
echo" Hello World";
?>
The following example creates a cookie named "user" with the value “ John Doe".
The cookie will expire after 30 days (86400 * 30).
The "/" means that the cookie is available in entire website (otherwise, select the directory you prefer).
We then retrieve the value of the cookie "user" (using the global variable $_COOKIE).
We also use the isset() function to find out if the cookie is set: