views:

807

answers:

1

In my asp.net website. I am putting some data into the UserData portion of the forms authentication ticket. Later I am then able to access this data using

(FormsIdentity)(HttpContext.Current.User.Identity).Ticket.UserData

My question is - as long as the authentication ticket is valid, will this data ALWAYS be available in the FormsIdentity.Ticket.UserData? Or will I eventually need to sync the FormsIdentity.Ticket.UserData and the UserData in the authentication ticket?

+1  A: 

Yes, it is encrypted with the authentication ticket, so it will be there as long as the same ticket is used. Edit: if you are changing the data, you will need to issue a new authentication ticket.

eglasius