PHP $_SESSION Simple securization issue
<p>I am building a session array with 3 information: <code>mail</code>, <code>password</code> and <code>id</code>. mail and password i use from the POST. Note that before using the data i use <code>mysql_real_escape_string</code> for the mail and sha1 for the password. But for id I get the value from the database. The question is: Should I do  <code>'id'=&gt;htmlentities($data['ENS_ID'])</code> instead of just <code>'id'=&gt;$data['ENS_ID']</code> for security purpose? Sorry if my question makes no sense to you but I am a bit lost with securization. Thank you in advance for your replies. Cheers. Marc</p>

<pre><code>$result = mysql_query("SELECT * FROM ENS_MEMBRES WHERE ENS_MAIL = '$mail' AND ENS_PASS = '$password'");

if(mysql_num_rows($result)==1){

    $data=mysql_fetch_assoc($result);   
    $_SESSION['Auth']=array(
        'mail'=&gt;$mail,
        'password'=&gt;$password,
        'id'=&gt;$data['ENS_ID'],
    );
</code></pre>
