title: PHP Session lost with different client ip
body: <p>I have a strange behaviour of sessions in PHP when I connect my client through a balanced gateway with two ip addresses to my hosting server.</p>
  
  <p>I correctly initialize a session with a cookie, I set a session boolean variable and for debug I print this informations:</p>
  
  <pre><code>    echo var_dump($_SESSION["islogged"]);
      echo var_dump(session_id());
      echo var_dump($_SERVER["REMOTE_ADDR"]);
  </code></pre>
  
  <p>Than I refresh many times the page and I get two results:</p>
  
  <pre><code>bool(false) string(26) "ism1vg1de6v0b1r8b2ng337uh3" string(13) "48.129.84.146" 
  bool(true) string(26) "ism1vg1de6v0b1r8b2ng337uh3" string(13) "96.19.184.38" 
  bool(true) string(26) "ism1vg1de6v0b1r8b2ng337uh3" string(13) "96.19.184.38" 
  bool(false) string(26) "ism1vg1de6v0b1r8b2ng337uh3" string(13) "48.129.84.146" 
  bool(false) string(26) "ism1vg1de6v0b1r8b2ng337uh3" string(13) "48.129.84.146" 
  bool(true) string(26) "ism1vg1de6v0b1r8b2ng337uh3" string(13) "96.19.184.38" 
  ...
  </code></pre>
  
  <p>Ad you can see the session is the same, however the session bar changes.
  Do you know how to solve this?</p>
  
  <p>This is the login check:</p>
  
  <pre><code>$ISLOGGED=!empty($_SESSION["islogged"]) 
  </code></pre>
  
  <p>And this is the logon code:</p>
  
  <pre><code>$ISLOGGED=$_SESSION["islogged"]=$_POST["password"]==$password;
  </code></pre>