For our demo website, demo.quickpm.net, I need to have a default automatic login. Using the ASP.Net Membership and FormsAuthentication an easy way to do auto-login is the following code
string userEmail = "john.doe@gmail.com";
string password = "thepassword";
if (Membership.ValidateUser(userEmail, password))
{
FormsAuthentication.SetAuthCookie(userEmail, true);
Response.Redirect("~/");
}
The above code assumes that “john.doe@gmail.com” is a user and “thepassword” is their password.
