I have a strange session problem with firefox (latest 1.5 version )
I have the following webform
<FORM METHOD="POST" ACTION="send.php" >
<?
session_start();
$secret = md5(uniqid(rand(), true));
$_SESSION['secret'] = $secret; // set the session
$auth = $_SESSION['secret'];
echo"<input type=\"hidden\" name=\"auth\" value=\"$auth\" /> ";
?>
and on send.php I have this
session_start();
if ( $_POST['auth'] != $_SESSION['secret'] )
{
echo "FAILED";
echo"<sup> ".$_SESSION['secret']."-- ".$_POST['auth']."</sup>";
}
else
{
echo"OK";
}
This is the problem
When I test this form using explorer 6 I receive "OK"
when I test this form using Firefox I receive "FAILED" and
$SESSION['secret'] and $POST['auth'] are NOT the same , because
Firefox generates a new $_SESSION['secret'] when opens send.php (?)
It does NOT happen with internet explorer !
Any idea ?
Thank you
Graziano