Jump to content


Photo

Proper Way to Check If Cookies Exist?


  • Please log in to reply
2 replies to this topic

#1 elg2001

elg2001
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 18 May 2006 - 11:42 PM

Is isset($_COOKIE['cookie_name']) the best way to check if a certain cookie named cookie_name exists?

Previously, I was using if(strlen($_COOKIE['cookie_name']) > 0) but that generates errors.

Basically, what is the best way to check for the existence of a cookie? isset() or otherwise?

#2 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 19 May 2006 - 12:37 AM

Use isSet()

#3 elg2001

elg2001
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 19 May 2006 - 05:14 AM

will do. thanks! [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users