title: User.Identity.IsAuthenticated is always false Even though e.Authenticated = true
body: <p>I have searched similar question but could not solve the problem.</p>
  
  <p>html code</p>
  
  <pre><code>  &lt;asp:Login ID="Login1" runat="server" Width="247px"       OnAuthenticate="Login1_Authenticate1"&gt;
                  &lt;/asp:Login&gt;
  </code></pre>
  
  <p>C# code</p>
  
  <pre><code>public partial class login : System.Web.UI.Page
  {
  private SqlConnection con = new     SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
  
  protected void Page_Load(object sender, EventArgs e)
  {
  
  }
  protected void Login1_Authenticate1(object sender, AuthenticateEventArgs e)
  {
      string userName = Login1.UserName;
      string password = Login1.Password;
  
      bool result = UserLogin(userName, password);
      if ((result))
      {
          e.Authenticated = true;
          FormsAuthentication.SetAuthCookie(userName, true);
          Response.Redirect("http://localhost:57000/Default");
      }
      else
      {
          e.Authenticated = false;
      }
  }
  private bool UserLogin(string userName, string password)
  {
  
      //' declare the command that will be used to execute the select statement 
      SqlCommand com = new SqlCommand("SELECT Employee_Email FROM Employee_Detail WHERE Employee_Email = @UserName AND Password = @Password", con);
  
          // set the username and password parameters
          com.Parameters.Add("@UserName", SqlDbType.NVarChar).Value = userName;
          com.Parameters.Add("@Password", SqlDbType.NVarChar).Value = password;
  
          con.Open();
          //' execute the select statment 
          string result = Convert.ToString(com.ExecuteScalar());
          //' check the result 
          if (string.IsNullOrEmpty(result))
          {
              //invalid user/password , return flase 
              return false;
          }
          else
          {
              // valid login
              return true;
          }
      }
  </code></pre>
  
  <p>}
  I am checking like this.
  <code>
       if (User.Identity.IsAuthenticated)
          {
              Page.Title = "Home page for " + User.Identity.Name;
          }
          else
          {
              Page.Title = "Home page for guest user.";
          }</code>
  Config File</p>
  
  <p><code>&lt;authentication mode="Forms"&gt;
        &lt;forms defaultUrl="~/Default.aspx" loginUrl="~/login.aspx" name="__Auth" slidingExpiration="true" timeout="2880"&gt;&lt;/forms&gt;
      &lt;/authentication&gt;</code></p>
  
  <p>The login works fine but when check User.Identity.IsAuthenticated in next      page it is always false. i have set authentication as form in config page.
  Any help would be great.</p>