try below
protected void login1_Authenticate(object sender, AuthenticateEventArgs e)
{
string un = login1.UserName;
string pw = login1.Password;
bool result = Userlogin(un, pw);
if (result)
{
FormsAuthentication.SetAuthCookie(un, true);
e.Authenticated = true;
Session["username"] = un;
}
else
{
e.Authenticated = false;
}
}