User logged out after password change

2 posts by 2 authors in: Forums > CMS Builder
Last Post: March 4, 2013   (RSS)

By gversion - March 1, 2013

Hello,

I have created a custom "change password" page in the custom built users' control panel area using Website Membership plugin.
Currently when the user changes their password and clicks "save" they are logged out of their account and need to login with their new password.

Is there a workaround for this that someone could share with me please so the user is not automatically logged out?

Regards

Greg

By gregThomas - March 4, 2013

Hi Greg,

After you have updated a users password or username in the database, you will need to run this function to update the users session data:

websiteLogin_setLoginTo( $CURRENT_USER['username'], $_REQUEST['newPassword'] );                // update current login session

You will need to changed $_REQUEST['newPassword'] to a variable that contains the users password that isn't encrypted.

Let me know if you have any questions.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com