c# - Forms Authentication and All fine except blank datavalue field -


I am trying to create and read a form authentication cookie in the AC # web app that I am developing.

I create a ticket

  formAssistationTiticket authTicket = new formattingTat (1, "MyData", Datetime.Now, Datetime.now.Admnates (60), true, Hello "); // Now Encrypt String String EncryptedTetic = Formatting Encrypt (authTicket); HttpCookie authCookie = New HttpCookie (Form Notification.FirmKookname, EncryptedTicket);  

// Add cookie to outgoing cookies collection. Add cookies. (Ash Cookie);

Then when I get back to the ticket using:

  http cookie aithkuki = context. request. Cookies [cookies]; FormAffnotificationTit authTicket = null; AuthTicket = forms.Authentication.Decrypt (authCookie.Value)  

I can see authTicket Now all the data, cookie creation date, end date, name = "mydata" ... etc. / P>

But there is nothing in the data value ... I'm hoping for "Hello".

When I debug, I can see that it is already in the ticket before encryption ... I think it's lost in decryption?

Any help?

When you use the property to set a cookie, when you read it, you Cookie names use the variable Do you really know the two points of the same cookie? Also, with firebug, verify that the value in the cookie is the same as when you debug.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -