title: Authorize Attribute is not working
body: <p>I am trying to use authorize attribute in my mvc 4 web api but it is not working. I know I am missing something but I am unable to find.</p>
  
  <pre><code>[HttpGet]
      [Authorize]
      public JArray getDistance(string origin, string destination)
      {
         some code..
      }
  </code></pre>
  
  <p>my web.config file is-</p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
    &lt;forms loginUrl="Login.aspx" requireSSL="true" cookieless="UseCookies" name="authcookie"  protection="All" slidingExpiration="false"&gt;
    &lt;/forms&gt;
  &lt;/authentication&gt;
  </code></pre>
  
  <p>my form authentication cookie is-</p>
  
  <pre><code>FormsAuthenticationTicket token = new FormsAuthenticationTicket(
              1,
              UserName,
              DateTime.Now,
              DateTime.Now.AddHours(24),
              false,
              "user Token"
  
              );
          string EncToken = FormsAuthentication.Encrypt(token);
          HttpCookie cookie = new HttpCookie("authcookie", EncToken);
          cookie.HttpOnly = true;
          HttpContext.Current.Response.Cookies.Set(cookie);
  </code></pre>