Pavlos1316 Posted June 17, 2008 Share Posted June 17, 2008 Hi When a member is changing his password how to I tell that to authentication script (to regognize that is still the same user and logged in) so the member won't have to login again until next time? Thank you Link to comment https://forums.phpfreaks.com/topic/110554-member-changing-password/ Share on other sites More sharing options...
conker87 Posted June 17, 2008 Share Posted June 17, 2008 How are you authorising them? Can we see the login script? And how are you checking if they are logged in? Link to comment https://forums.phpfreaks.com/topic/110554-member-changing-password/#findComment-567156 Share on other sites More sharing options...
Pavlos1316 Posted June 17, 2008 Author Share Posted June 17, 2008 Login script: <?php [color=red]db connection string[/color] session_start(); $Username=$_POST['Username']; $Password=md5($_POST['Password']); $query="SELECT ID FROM Register WHERE Username='$Username' AND Password='$Password'"; $result=mysql_query($query); if(mysql_num_rows($result)>0){ session_regenerate_id(); $member=mysql_fetch_assoc($result); $_SESSION['SESS_ID']=$member['ID']; session_write_close(); include 'members_area.php'; exit(); ?> Authentication script: <?php session_start(); if(!isset($_SESSION['SESS_ID']) || (trim($_SESSION['SESS_ID'])=='')){ header("location: http://"); exit(); } ?> Link to comment https://forums.phpfreaks.com/topic/110554-member-changing-password/#findComment-567182 Share on other sites More sharing options...
conker87 Posted June 17, 2008 Share Posted June 17, 2008 It looks like it wont matter. Since you don't have the password or username in the session authorisation. Link to comment https://forums.phpfreaks.com/topic/110554-member-changing-password/#findComment-567183 Share on other sites More sharing options...
Pavlos1316 Posted June 17, 2008 Author Share Posted June 17, 2008 It does cause if I change it when I try to access another members page it takes me back to the login page Link to comment https://forums.phpfreaks.com/topic/110554-member-changing-password/#findComment-567389 Share on other sites More sharing options...
conker87 Posted June 17, 2008 Share Posted June 17, 2008 Your login script appears to be missing a closing curly bracket. Other than that, I don't really know why it's logging you out when clearly it shouldn't. Link to comment https://forums.phpfreaks.com/topic/110554-member-changing-password/#findComment-567397 Share on other sites More sharing options...
Pavlos1316 Posted June 17, 2008 Author Share Posted June 17, 2008 sorry.. It was continued like }else{ $error="Invalid Login"; } I can't think what is wrong... Maybe my authentication script when changing password automatically deletes the stored data so when the member tries to access another page is like his is not logged in!! But how do I correct that? Link to comment https://forums.phpfreaks.com/topic/110554-member-changing-password/#findComment-567401 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.