Working on login system and trying to implement remember me feature.
Recently, l did research about this subject, read bunch of articles, posts, stories, n
But I really confused about my main problem: which way is proper, for "remember me" feature? to use cookies/session/database?
Http is a stateless protocall. Authentication token must persist to keep the state. Proper way is to use session. Now how do you track the session? It's up to you. But cookies are not bad.
In the session you can save a hash created from browser different criteria(user agent, os, screen resolution etc) to check if the token is from same environment. The more criteria you save the more itll be harder to hijack. Btw you need JavaScript to grab ths extra information every time.