Advertisement
PLASTKHP

PHP Create/Retrieve a Cookie

Dec 15th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. PHP Create/Retrieve a Cookie
  2.  
  3. 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).
  4.  
  5. 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
  6.  
  7. Download from here: http://bonviral.fun/ran?r=9nytC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement