Secure Login Script
<p>I'm creating a secure login script at the moment. The script works like this:</p>

<p>1) On page load, a session ID is generate (session_start)</p>

<p>2) User enters username and password</p>

<p>3) Script clean the user input.</p>

<p>4) Username and password are checked for match in database,</p>

<p>5) If successful, a new session ID is generated, and the user is logged into their account.</p>

<p>Upon the user logging in, how do I retrieve all relevant information about the user from the database? I'm currently storing the user ID (an auto_increment field) in a session, and am using this search for the relevant details in the database?</p>

<p>Is this secure?</p>
