Lister777 Posted March 7, 2006 Share Posted March 7, 2006 Hi allWas wondering if somone could point me in the correct direction for learning about adding a remember me check box to my login script.I have had a look though some of the other tutorials and the php manual but to be honest not 100% sure on what i am looking for. Would guess that its done by storing a Cookie on the users system yes?Any help would be great.Many thanksLister777 Quote Link to comment Share on other sites More sharing options...
Steveo31 Posted March 7, 2006 Share Posted March 7, 2006 Right. The gist of it would be to check to see if the cookie exists. If so, then the necessary info will be in there, like usernames or whatnot. If not, then set it:[code]<?phpsetcookie('login_info', 'username', time()+60*60*24*30);?>[/code]i.e.[code]<?phpif(isset($_COOKIE['login_info'])){ $_SESSION['username'] = $_COOKIE['login_info'];}else{ //show login form or something}?>[/code] Quote Link to comment 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.