"Keep Me Logged In" - the best approach
<p>My web application uses sessions to store information about the user once they've logged in, and to maintain that information as they travel from page to page within the app. In this specific application, I'm storing the <code>user_id</code>, <code>first_name</code> and <code>last_name</code> of the person. I'd like to offer a "Keep Me Logged In" option on log in that will put a cookie on the user's machine for two weeks, that will restart their session with the same details when they return to the app. What is the best approach for doing this? I don't want to store their user_id in the cookie, as it seems like that would make it easy for a user to try and forge the identity of another user.</p>
