SHARE
TWEET

PHP Create/Retrieve a Cookie

kimo20 Oct 10th, 2019 57 in 26 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 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).
  2.  
  3. 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:
  4.  
  5. Download File on Media fire : http://j.gs/DIUk
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top