yami007 Posted December 3, 2008 Share Posted December 3, 2008 i simply can do it with cookies, but i dont how to link it with the remember me checkbox, well, this is how i learnt to do it only with cookies <?php $found_one_user = mysql_fetch_array($user); $_SESSION['user_id'] = $found_user['id']; $_SESSION['username'] = $found_user['username']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/135381-how-can-i-add-the-remember-me-feature-to-login-form/ Share on other sites More sharing options...
premiso Posted December 3, 2008 Share Posted December 3, 2008 That is not really with cookies. You need to use the setcookie function if that checkbox is checked. Then you need to modify your authenticate function to validate cookies if they are set and sessions is not and then set them to the session so you just always access session. Although session is stored in a cookie, it gets wiped on a browser close. Cookies stay alive until a user logs out and you destroy them or they clear their browser's cookies out manually. Hope that helps. Quote Link to comment https://forums.phpfreaks.com/topic/135381-how-can-i-add-the-remember-me-feature-to-login-form/#findComment-705149 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.