3 Replies - 1725 Views - Last Post: 26 January 2011 - 08:39 PM

#1 paperclipmuffin   User is offline

  • Disassembling...
  • member icon

Reputation: 13
  • View blog
  • Posts: 944
  • Joined: 16-April 09

Cookies

Posted 22 July 2009 - 08:51 PM

Description: Drops a .txt cookie into the cookies folder of the receiving computer. This can later be read to decipher its contents.
<?php
//-------Create the cookie-------
    //These are the values of the cookie:
  $name;
  $value;
  $expiretimer; 
    //The expire timer is in seconds. After the said amount of
    //time has passed, the cookie is destroyed.
  setcookie($name, $value, $expiretimer);
    //This sets an encoded cookie, meaning the user cannot change it. You can
    //set a "raw" cookie, meaning the cookie is not encoded, by using this:
  setrawcookie($name, $value, $expiretimer);
//-------- Read the cookie -------
  $val=$_cookie["cookiename"];
    //This sets val to the value of the cookie.
//-------Delete the cookie-------
    //We have a cookie called "dumb" in our cookies folder. To remove it:
  setcookie("dumb", "", time()-500);
?>


Is This A Good Question/Topic? 0
  • +

Replies To: Cookies

#2 Denis1   User is offline

  • D.I.C Head
  • member icon

Reputation: 32
  • View blog
  • Posts: 104
  • Joined: 29-July 09

Re: Cookies

Posted 06 August 2010 - 10:03 AM

thank you for this i love it
Was This Post Helpful? 0
  • +
  • -

#3 Angelsmadream   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 20-January 11

Re: Cookies

Posted 24 January 2011 - 06:12 AM

Thanks its helpful
Was This Post Helpful? 0
  • +
  • -

#4 borninlyoko   User is offline

  • D.I.C Regular
  • member icon

Reputation: 7
  • View blog
  • Posts: 350
  • Joined: 03-December 09

Re: Cookies

Posted 26 January 2011 - 08:39 PM

Cookies are always useful in webpages, thanks :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1