title: FormsAuthenticationTicket UserData returns empty for roles
body: <p>I have a simple code, which is based on <a href="http://www.codeproject.com/Articles/2905/Role-based-Security-with-Forms-Authentication" rel="nofollow">article</a></p>
  
  <p>but my code doesn't work, and I don't know where is my fault. I use non membership API. Please help with advise:<br/>
  Button_Click:</p>
  
  <pre><code> FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, txtUsername.Text, DateTime.Now, DateTime.Now.AddMinutes(1), true, role, FormsAuthentication.FormsCookiePath);
   HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(ticket));
   if (ticket.IsPersistent) cookie.Expires = ticket.Expiration;
   Response.Cookies.Add(cookie);
   FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, true);
  </code></pre>
  
  <h2>Global.asax - Application_AuthenticateRequest</h2>
  
  <pre><code> if (HttpContext.Current.User != null)
   {
      if (HttpContext.Current.User.Identity.IsAuthenticated)
      {
         if (HttpContext.Current.User.Identity is FormsIdentity)
         {
           FormsIdentity formsIdentity = (FormsIdentity)HttpContext.Current.User.Identity;
           FormsAuthenticationTicket ticket = formsIdentity.Ticket;
           string userData = ticket.UserData;
           string[] roles = userData.Split(',');
           HttpContext.Current.User = new System.Security.Principal.GenericPrincipal(formsIdentity, roles);
         }
     }
   }
  </code></pre>
  
  <h2>web.config</h2>
  
  <pre><code> &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0" /&gt;
    &lt;authentication mode="Forms"&gt;
      &lt;forms loginUrl="login.aspx"
             timeout="1"
             slidingExpiration="true"
             cookieless="AutoDetect"
             protection="All"
             defaultUrl="logined.aspx"
             path="/"&gt;
      &lt;/forms&gt;        
    &lt;/authentication&gt;
    &lt;authorization&gt;
      &lt;deny users="?"/&gt;
    &lt;/authorization&gt;
   &lt;/system.web&gt;
   &lt;location path="default.aspx"&gt;
   &lt;system.web&gt;
    &lt;authorization&gt;
      &lt;allow users="*"/&gt;
    &lt;/authorization&gt;
   &lt;/system.web&gt;
   &lt;/location&gt;
   &lt;location path="register.aspx"&gt;
   &lt;system.web&gt;
    &lt;authorization&gt;
      &lt;allow users="*"/&gt;
    &lt;/authorization&gt;
   &lt;/system.web&gt;
   &lt;/location&gt;
   &lt;location path="adminPage.aspx"&gt;
   &lt;system.web&gt;
    &lt;authorization&gt;
      &lt;allow roles="Admin"/&gt;
      &lt;deny users="*"/&gt;
    &lt;/authorization&gt;
   &lt;/system.web&gt;
   &lt;/location&gt;
  </code></pre>
  
  <p>In debugger I see that string role isn't got from Button_Click method into Application_AuthenticateRequest. So, if role in Button_Click is equal "Admin" for it's username then in Application_AuthenticateRequest the same variable as ticket.userData is equal "". Why is this happens? </p>