title: How to do auto login, store the session in the browser
body: <p>I have seen some social network sites, if you have a user account, and when you open the browser and type the url, you will be directly loged in without inputting the username and password even if you close the computer and restart the browser your can still be automatically loged in which is different form before which you need to log in with your log in details, I think this is not only include  the session cookie like the following</p>
  
  <pre><code>    setcookie(session_name(), '', time()-2592000, '/');
  </code></pre>
  
  <p>but might be more complicated than it. suppose if I use php, can anybody tell me how to implement this function, I assume it's done on the server side, sorry if I didn't make clear description.</p>