When ASP. NET Forms authentication method encounters Apple IOS
I. The problem occurs when I use ASP. NET MVC4 for development, I use Forms as authentication. Generally, they are added in web. config: <authentication mode = "Forms"> <forms loginUrl = "~ /Account/Login "name =" webcookies "slidingExpiration =" true "timeout =" 30 "/> </authentication> then, after the user successfully logs on, set Cookies. The Code is as follows: copy the public static void SetTicket (HttpResponseBase response, bool remeberMe, int version, string identity, string displayName) {FormsAuthentication. setAuthCookie (identity, remeberMe); string userData = displayName; var authTicket = new FormsAuthenticationTicket (version, identity, D AteTime. Now, DateTime. Now. AddDays (remeberMe? 30: 1), remeberMe, userData); string encrytedTicket = FormsAuthentication. encrypt (authTicket); HttpCookie authCookie = new HttpCookie (FormsAuthentication. formsCookieName, encrytedTicket); response. cookies. add (authCookie);} copy the code. I use FormsAuthenticationTicket here. version stores the User Role ID. At the beginning, I was proud of my wit and exquisite design, and I had no problem running on Android phones. However, on IOS, No matter what value I set for Version, its value is always 2. According to msdn: If FormsAuthenticationTicket is created using a constructor that does not provide the version parameter, the Version attribute returns 2; otherwise, the Version attribute returns the value provided to the FormsAuthenticationTicket constructor. I have already created a constructor that provides the version parameter, but it cannot be used on IOS. I have not obtained a good explanation for a lot of materials. I hope that the blogs can help me explain this problem. Later I saw the bottom of Microsoft's page: supported platforms: Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, windows Vista SP2, Windows Server 2008 (core roles of servers are not supported), and Windows Server 2008 R2 (core roles of servers with SP1 or higher are supported; Itanium is not supported. No matter what, the problem that has plagued me for a long time has finally found the problem. I would like to warn the latecomer here.