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.
I came cross this post here and understanding the best ways of implementation.
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?
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?
What is the preferred way of implementation among these two approaches?