Posted on: 2/26/2011 1:25:23 PM | Views : 341

I have this code for changing a user's password when they click the password reset button (with extra code to log to ELMAH so I can try to figure out what is going wrong).

This is in ASP.NET MVC 2, using the standard aspnet membership provider, with a simple View like this:

    New Password:     ______
    Confirm Password: ______
    [Reset] [Cancel]

The route to this view is `/Account/Reset/guid`, where guid is the user's id in the aspnet membership database.

The key portion of the code is where it calls `user.ChangePassword()`.  You can see that it logs a message when successful.  The problem is that for some users, the success message is logged, but they can not log in with the new password.  For other users it logs the success message and they can log in.

    if (user.ChangePassword(pwd, confirmPassword))
 &nbs ...

Go to the complete details ...