title: codeigniter php native sessions without using cookies or URL session id, but matching browserfingerprints in database
body: <p>Because of european privacy law being harsly applied in the Netherlands and to keep my company's site user friendly without nagging the users with questions if it's okay to store a cookie on their computer that allows me to access their client data.</p>
  
  <p>What I need is a way to "overwrite" the native php sessions class so that at the point where the native class requests the cookie that stores the phpsessid, that I can place my own code there that checks the browsers fingerprint and matches that to a session id which I can use to return the normal working of the native class.</p>
  
  <p>My idea is:</p>
  
  <p>table sess_fingerprints
  Fields: fingerprint - phpsessid</p>
  
  <pre><code>function getsessionid()
      {
      $result = $this-&gt;db-&gt;query("SELECT phpsessid 
                      FROM `sessiondatabase`.`sess_fingerprints` 
                      WHERE `sess_fingerprints`.`fingerprint` = '$userfingerprint'");
      if($result-&gt;num_rows() != 0)
          {
          return $result-&gt;row-&gt;phpsessid;
          }
      }
  </code></pre>
  
  <p>and at that point the native php session code just works as it would normally do.</p>
  
  <p>So, my question is: is it possible to overwrite only the "cookie" part of the phpsession class? if so, how? because I haven't found that yet.</p>
  
  <p>I'm aware of being able to pass along the session variable via urls etc, but that's not secure enough for my web applications.</p>