title: Difference of inpmementations in PHP: remember a user using cookies and session.cookie_lifetime in php
body: <p>This is a standard situation. Suppose  a user log in to a website and closes the brwoser. He again visits the same website. I want the website to identify the user without asking him to login again.</p>
  
  <p>I came cross <a href="https://stackoverflow.com/questions/244882/what-is-the-best-way-to-implement-remember-me-for-a-website">this post here</a> and understanding the best ways of implementation.</p>
  
  <p>After reading many similar threads here, I know one best way of implementing this is to set a hash and store in a cookie so that I can check for this hash when the user visits next time and identify the user. Whether this approach has security issues like if the cookie is transferred to other system, it can also get logged in session?</p>
  
  <p>But, why can't we just implement it using session.cookie_lifetime and 
  session.gc_maxlifetime variables, say with large values so that session never expires? Does this approach have issues such as potentially large data may come to the server?</p>
  
  <p>What is the preferred way of implementation among these two approaches?</p>