Forms authentication issue
<pre><code>&lt;authentication mode="Forms"&gt;
        &lt;forms loginUrl="LoginPage.aspx"
           protection="All"
           timeout="1"
           name=".ASPXAUTH"
           path="/"
           requireSSL="false"
           slidingExpiration="false"
           defaultUrl="HomePage.aspx"
           cookieless="UseDeviceProfile"
           enableCrossAppRedirects="false"/&gt;
      &lt;/authentication&gt;

protected void btnSubmit_Click(object sender, EventArgs e)
        {
           int recordExistCount = fc.Authenticate(txtUsername.Text.Trim(), txtPassword.Text.Trim());
           if (recordExistCount == 1)
           {
               Session["User"] = "Authenticated";
               Session["Username"] = txtUsername.Text.Trim();
               fc.IsOnlineRecord(Session["Username"].ToString(),true);
               FormsAuthentication.RedirectFromLoginPage(Session["Username"].ToString(), true);
           Response.Redirect("HomePage.aspx");
           }
           else
           {
               lblStatus.Text = "Username or password specified are incorrect";
               lblStatus.BackColor = Color.Yellow;               
           }
        }
</code></pre>

<p>Forms authentication doesnt work properly. After one successfull login , I go to the website url and it doesnt go to Homepage and instead takes me again to the loginpage.
What am I doing wrong?</p>
