LyleCrumbstorm Posted April 18, 2013 Share Posted April 18, 2013 I hope I am posting in the appropriate place. Although I didn't create this code I did write it while following along with the phpacademy 44 video tutorial on Register & Login. Next I followed the 6 video tutorial on creating a "Remember Me" cookie in order to bypass the login. Unfortunately these 2 series were not designed to go together so I am left with a very complex login system via "Register & Login" and no understanding of how to implement the "Remember Me" feature. Before I go uploading any code or copying & pasting anything I would like to throw out a general question as I've posted this on several message boards & PHP Forums so far to no avail - Is there anyone here who has implemented a "Remember Me" feature into the "Register & Login" series presented by phpacademy? This might be a simple exercise within any other login system but this one seems to have left everyone stumped so far. I will gladly upload any files or make any informatio available if anyone is interested. Otherwise it is a lot work only to risk looking like someone who is asking for handouts. Quote Link to comment Share on other sites More sharing options...
lemmin Posted April 18, 2013 Share Posted April 18, 2013 If the user checks "Remember Me," set a cookie that will never expire with his username and a unique token that you can store on your server and check authenticity. When the user leaves for a while, his session might time out, but when he comes back, you can log him back in automatically if the token matches what you stored for him. http://us3.php.net/manual/en/function.setcookie.php Quote Link to comment Share on other sites More sharing options...
LyleCrumbstorm Posted April 18, 2013 Author Share Posted April 18, 2013 I understand that. This problem requires someone familiar with how this specific login routine was written. I'm ashamed to admit that I am too much of a newbie to figure this out on my own and countless hours of struggling has returned the most success I've had which is an endless loop (meaning I've set the dang cookie successfully but I can't trace the logic back to where the loop is happening.) I know, I know - how straightforward could this be?! That's what I thought until the past week of posting this question on every PHP Message Board has only resulted in more confusion by everyone involved. I'll gladly post whatever code you, or anyone else would like to see but there is an ever-loving crapton of it as this Register & Login system is exceptionally involved. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted April 18, 2013 Share Posted April 18, 2013 This problem requires someone familiar with how this specific login routine was written. that's not correct. it requires someone with enough understanding of the php language (and of the security implications) that they can identify where in the login code to add the logic to do the first step of what lemmin stated and where in the logged-in session check code to add the logic to do the second part of what lemmin stated. it would also require someone to add the checkbox to the form, to add a column to the database table to hold the unique token value, to modify the logout code so that it clears the unique token in the database table, along with creating or identifying those parts of the remember me logic. Quote Link to comment Share on other sites More sharing options...
lemmin Posted April 18, 2013 Share Posted April 18, 2013 Post the code where you set the cookie and also where you look for that cookie. 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.