使用cookie跟踪访问者PHP [关闭]

The scenario would be the following: a user is landing to my website and is getting a cookie and together with other parameters(referrer, page_id, IP-Address, landing time etc) should be saved to database. If the same visitor is accessing another page what is different than the landing page all this information should be updated. What could be those PHP functions what would let me to handle in an elegant way this task?

  1. setcookie()
  2. $_COOKIE[]

All cookies are available for every page on the same domain, unless you specify otherwise.

edit: Looks like you want to use the $_SERVER magic variable.