FormsAuthenticationTicket after authentication by not landing --- possible problems

This is my own encountered, FormsAuthenticationTicket after authentication by the still existing problems can not log on, commissioning a long time did not find the problem, because if suddenly thought of the last cookie length limit, resulting in information can not be stored to the cookie, enter after commissioning the experiment had found that really is the problem, so this say about the specific cause of the problem:

FormsAuthenticationTicket.UserData is no length limit, but we are sometimes confused too long, the situation can not record the user's login status will appear, this is why?

When UserData too long after FormsAuthentication.Encrypt encryption becomes longer, if our information is stored in a Cookie, when data encryption over 4096 this will save afford Cookie (no error), natural You will not be able to record user login status.

By the way, if you do not specify UserData, the encrypted content is always 256 bytes.

Guess you like

Origin www.cnblogs.com/aimevous/p/11407760.html