title: What am I doing wrong with my FormsAuthenticationTicket?
body: <p>I am trying to recreate my cookie what would be normally generated by FormsAuthentication.SetAuthCookie() and what is in the webconfig.</p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
              &lt;forms loginUrl="~/Account/LogOn" protection="All" timeout="20160" name=".ASPXAUTH" path="/" requireSSL="false" slidingExpiration="false" defaultUrl="default.aspx" cookieless="UseDeviceProfile" enableCrossAppRedirects="false"/&gt;
          &lt;/authentication&gt;
  </code></pre>
  
  <p>However I want to send one more piece of data along so as far as I understand I have to make my own FormsAuthenticationTicket to add this data(or merge it all with the userName in SetAuthCookie and do splitting).</p>
  
  <p>So I am trying to get it as secure(or more secure) as the one it makes from the webconfig, have the same values as the one generated from the webconfig.</p>
  
  <p>So this is what I have so far</p>
  
  <pre><code> FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, "chobo2", DateTime.Now, DateTime.Now.AddYears(10), true, "test");
              string encTicket = FormsAuthentication.Encrypt(ticket);
              Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket));
  </code></pre>
  
  <p>However I am still not sure what it is using. Does it use stuff from the webconfig? Since it does not ask for a cookieName nor a timeout.</p>
  
  <p>When I look at this cookie through web developer it says it not secure, and that it expires in the end of session.</p>
  
  <p>When I look at the one generated from the webconfig it has a expiry date of like october 12th and still says not secure(guess it is refering to SSL).</p>
  
  <p>Also I am still confused about the userData. How do I add I grab this value later on? How do I add more then once peice of data? </p>
  
  <p>Do I always have to decrypt(ie call the decrypt method) to decrypt the cookie or does it do it automatically.</p>
  
  <p>What kind of encryption is the cookie using by default anyways?</p>
  
  <p>Thanks</p>