When to use FormsAuthenticationTicket()

G

Guest

Hi, guys,

After I use FormsAuthentication.SetAuthCookie() to anthenticate a user, I
don't think I need to create a new FormsAuthenticationTicket(), right?

Then, at what situation, we should use ticket? Any reference papers?

Thanks.
 
B

Brock Allen

The only time you'd need to work with the FormsAuthTicket is if you wanted
to manually issue the Form Auth Cookie. When you call FormsAuth.SetAuthCookie
it creates the ticket, encrypts it then issues that as the cookie. The main
reason you'd want to do this yourself is that the FormAuthTicket allows you
to put in some user-defined data inside of it. This is nice since FormAuth
does encryption and MAC protection on the ticket (so you don't have to).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,158
Latest member
Vinay_Kumar Nevatia
Top