Log In User with Parameters when Changing Password
<p>I have an ASP.NET App in which want to send an email to a user that presses a Recover Password button that resets the user's password and then sends a link to the user that when followed will log the user in with a new password and bring them to the Change Password page where they must resent their password.  </p>

<p>I'm able to reset the password and get the new randomly generated password that I send back to the user in an email.  However, when the user follows the link back with the UserName and pw parameters, the system does not seem to log them in,</p>

<p>Here's the code I am using on the load event that does not seem to work:</p>

<pre><code>try
{
    string sUserName = Request.QueryString["UserName"].ToString();
    string sPw = Request.QueryString["pw"].ToString();

    if (Membership.ValidateUser(sUserName, sPw))
    {
        //Log the user in???
        FormsAuthentication.Authenticate(sUserName, sPw);
    }
}

catch (Exception r)
{
    string sMessage = r.Message;
}
</code></pre>

<p>Any help in logging the user in with username and password parameters would be greatly appreciated.</p>
