title: Same Session, Different Browser
body: <p>I'm storing <strong>actively changing data</strong> in user sessions, <strong>which requires consistency</strong> for the user even if they log in with another browser or PC and end up with a new PHP-generated session_id</p>
  
  <p>To counter this issue (and for other reasons) I store a username and session_id data pair in a maintained dedicated database, then after session_start() do something like (simplified):</p>
  
  <pre><code>$saved_sessid=$db-&gt;querySingle("SELECT sessid FROM sessions WHERE user = '".$user."'");
  if(!empty($saved_sessid)){
   session_write_close();//dump newly generated session
   session_id($saved_sessid);//apply database-saved session_id
   session_start();//launch the already existing user session
  }
  </code></pre>
  
  <p>Would this work as might be expected to make sure a particular user (based on logged in username) only has a particular PHP session or might it cause any unforseen issues, potentially security-related ones? I've been unable to find similar cases or test it reliably enough on my own and could do with some more experienced input</p>