title: Forms authentication not working with jQuery
body: <p>I am doing forms authentication as follows:</p>
  
  <pre><code>                if (strRole != null)
              {
                  FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
                     1,                            // version
                     username,                      // user name
                     DateTime.Now,                 // create time
                     DateTime.Now.AddSeconds(500),  // expire time
                     false,                        // persistent
                     strRole);                     // user data
  
                  string strEncryptedTicket = FormsAuthentication.Encrypt(ticket);
                  HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, strEncryptedTicket);
                  Context.Response.Cookies.Add(cookie);
                  return true;
              }
  </code></pre>
  
  <p>then on another page i have jQuery as follows</p>
  
  <pre><code>$.ajax({
      type: "POST",
      crossOrigin: true,
      url: "./WebService.asmx/Login",
      data: JSON.stringify({'username':username,'password':password}),
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function (response) {
          if (response.d === true) {
              $(location).attr('href', '/dash/dashboard.aspx')
          }
          else {
              ShowErrorModal("Invalid login or password.","login");
          }
      }
  });
  </code></pre>
  
  <p>the issue is in the on_load event of dashboard.aspx page, the following is always false</p>
  
  <pre><code>HttpContext.Current.User.Identity.IsAuthenticated
  </code></pre>
  
  <p>the question is what does it consider user is not authenticated.</p>
  
  <p>any help will be much appreciated.</p>