What to store in a session
<p>If a user successfully enters a password and username, and you want to set the session, what data should the session contain? I'm quite confused about this, I've read that it should be a randomly generated string, can I store hashed user_id + salt? I want to be able to verify that this is indeed the correct user:</p>

<p>The form:</p>

<pre><code>&lt;form method="POST" action=""&gt;
&lt;input type="hidden" name="auth_token" value="&lt;?php echo $form_token; ?&gt;"&gt;
Username: &lt;input type="text" name="username"&gt;
Password: &lt;input type="password" name="password"&gt;
&lt;input type="submit" name="action" value="Login"&gt;
&lt;/form&gt;
</code></pre>

<p>I want to do something like the following:</p>

<pre><code>if form token in session = form_token var in form
  if username and password are correct
    set session hash(user_id + salt)
</code></pre>

<p><strong>Edit:</strong> Forgot to add, it'll most likely be on shared hosting.</p>
