just got the code from here http://stackoverflow.com/a/21740549/6188148
as far as i know auth cookie content is encrypted by asp.net engine. below code try to use his encryption and decryption logic to encrypted cookie content ?
please tell me what the below code try to do ?
app.UseCookieAuthentication(newCookieAuthenticationOptions(){TicketDataFormat=newMyCustomSecureDataFormat()});publicclassMyCustomSecureDataFormat:ISecureDataFormat{privatestaticAuthenticationTicket savedTicket;publicstringProtect(AuthenticationTicket ticket){//Ticket value serialized here will be the cookie sent. Encryption stage.//Make any changes if you wish to the ticket ticket.Identity.AddClaim(newClaim("Myprotectionmethod","true"));returnMySerializeAndEncryptedStringMethod(ticket);}publicAuthenticationTicketUnprotect(string cookieValue){//Invoked everytime when a cookie string is being converted to a AuthenticationTicket.returnMyDecryptAndDeserializeStringMethod(cookieValue);}}