Schlo_50 Posted April 30, 2008 Share Posted April 30, 2008 Hi there, Im after a guide or snippet of code that will help give me an idea how to create add the 'remeber me' feature to my login form. I'd ideally like to do this without the use of a mysql database, which sadly most of the tutorials I have looked for on Google use. I just need the remember me feature to automatically sign in people when they visit my page. The page will only be used by 3 or 4 people, so there won't be hundred of users data/ip's to remember or anything. Can this be done? Any help welcomed! Thanks in advance Quote Link to comment Share on other sites More sharing options...
sandsquid Posted April 30, 2008 Share Posted April 30, 2008 you can try http://www.evolt.org/article/comment/17/60265/index.html and just skip the first part and go down to flat file db. Quote Link to comment Share on other sites More sharing options...
revraz Posted April 30, 2008 Share Posted April 30, 2008 Use a Cookie. Quote Link to comment Share on other sites More sharing options...
Rohan Shenoy Posted April 30, 2008 Share Posted April 30, 2008 Since you are already suing a login system, you may already be using a cookie? Just prolong the expiration time of the cookie. eg: Instead of setcookie("username","Schlo_50"); //this will set a cookie which will expire as soon as the browser is closed use : $cookie_life_span=time()+(60*60)//current time+(60 mins* 60 sec) =set a cookie that will expire after 1 hr. setcookie("username","Schlo_50",$cookie_life_span); //this will set a cookie which will expire as soon as the browser is closed 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.