faqts : Computers : Programming : Languages : PHP : Common Problems : Cookies

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

27 of 60 people (45%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

I know how to set a cookie using but I am not sure what to do after that, how can I identify a user through a number of scripts using cookies?

Mar 15th, 2000 19:14
Dave Garth, Dave Martindale,


To identify a user with a cookie you could give them a userID:
  $userID = uniqid(rand());
  setcookie("userID",$userID,time()+6000,"/path/","domain",0);
then to identify them check the $userID variable.