session php rand other values
<p>i have since two days the same error and i dont know how to fix that.</p>

<p>if i connect the first time to my webside i get other rand() numbers - as i reload my webside a second or a third time ...</p>

<p>index.php/</p>

<pre><code>if(!isset($_SESSION)) {  session_start();  }
require_once('token.php');


var_dump($_SESSION['tok']);
</code></pre>

<p>token.php/ </p>

<pre><code>if(!isset($_SESSION)) {  session_start();  }

if(!isset($_SESSION['tok'])) { $_SESSION['tok'] = rand();}
</code></pre>