Session variable not maintaining value
<pre><code>//Check against CSFR here
            $key = md5(uniqid(rand(), TRUE));
            //$key = "234"; //using this works but not the idea
            $_SESSION['key'] = $key;


//form
&lt;form method="post" action="&lt;?php echo HTTPF; ?&gt;/complete_reg"&gt;
        &lt;p&gt;
            &lt;label&gt;
                &lt;b&gt;Email address:&lt;/b&gt;&lt;br /&gt;
                &lt;input type="text" id="user_email" name="user_email" value="" class="register_email" onblur='$("#checkid").html("Please wait..."); $.get("er_checkuser.php",{ cmd: "check", check_key: $("#check_key").val(), user: $("#user_email").val() } ,function(data){  $("#checkid").html(data); });' /&gt;
            &lt;/label&gt;
            &lt;input type="hidden" id="check_key" name="check_key" value="&lt;?php echo $key; ?&gt;" /&gt;
            &lt;span style="color:red; font: bold 12px verdana; " id="checkid" &gt;&lt;/span&gt;

        &lt;/p&gt;

//calling page
//er_checkuser.php
foreach($_GET as $key =&gt; $value) {
    $get[$key] = filter($value);
}

//For some reasons I don't know why the values are not the same but they should be
if ($get['check_key'] == $_SESSION['key'])

{

    echo $_SESSION['key'];
    echo "&lt;br&gt;";
    echo $get['check_key'];
}
</code></pre>
