title: What is the most accurate way to assign unique ID to each visitor?
body: <p>I am looking for an accurate way to assign an ID to each visitor to my website. If they return they must keep the same ID. My current method is having lots of miss fires and is assigning new IDs to returning visitors.. obviously this can change with device, IP, etc..</p>
  
  <p>At the moment, when my site gets a new visitor it will log their IP in the database, the ID will become their ID.. when they return we do a lookup to see if their IP is matched,  obviously this is not reliable it could easily return more than one, if it does we then look for ip and user agent.</p>
  
  <p>In total we do 3 checks:</p>
  
  <pre><code>$_SERVER['REMOTE_ADDR']
  $_SERVER['HTTP_X_FORWARDED_FOR'];
  $_SERVER['HTTP_USER_AGENT'];
  </code></pre>
  
  <p>If we can't find an entry that matches all 3 then we class this as a new visitor.</p>
  
  <p>Is there a better method?</p>