jorsh1
jorsh1

Reputation: 291

FormsIdentity.Ticket.UserData and authentication ticket.UserData staying in sync

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?

Upvotes: 2

Views: 2827

Answers (1)

eglasius
eglasius

Reputation: 36037

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.

Upvotes: 2

Related Questions