A few people have said that they have noticed problems the new iPhone/iPad Google Chrome apps as well as trouble with applications that use hosted Safari inside of UIWebView (which is what Chrome is) or apps that host a website in PhoneGap. If you're using FormsAuthentication (in WebForms or MVC, doesn't matter) then Google Chrome for iOS might switch FormsAuth to Cookieless mode, which sucks for everyone.
少数人说,他们注意到新的iPhone / iPad Google Chrome应用程序出现问题,以及在UIWebView(Chrome即为Chrome浏览器)中使用托管Safari的应用程序或在PhoneGap中托管网站的应用程序出现问题。 如果您使用的是FormsAuthentication(在WebForms或MVC中无关紧要),则iOS的Google Chrome可能会将FormsAuth切换为无Cookie模式,这对所有人来说都很糟糕。
This has been fixed in .NET 4.5 and you won't see this problem if you have .NET 4.5 installed, even if you're running a .NET 4 application. For example, Bing.com is running .NET 4 applications under .NET 4.5 RC and wouldn't see this. If you install 4.5 (now or later) ASP.NET will always assume clients support cookies.
.NET 4.5中已修复此问题,即使您正在运行.NET 4应用程序,如果安装了.NET 4.5,也不会出现此问题。 例如,Bing.com在.NET 4.5 RC下运行.NET 4应用程序,并且看不到此内容。 如果安装4.5(现在或更高版本),ASP.NET将始终假定客户端支持cookie。
If you want to tell ASP.NET 4.0 or earlier that EVERY browser supports cookies for FormsAuth you can do ONE of these things:
如果你想告诉ASP.NET 4.0或更早版本,每一个为FormsAuth浏览器支持Cookie,你可以做的这些东西:
1.为您的应用程序(或计算机)更改Generic.Browser (1. Change Generic.Browser for your app (or machine))
Make a file called generic.browser in a folder called App_Browsers and put this in it:
在名为App_Browsers的文件夹中创建一个名为generic.browser的文件,并将其放入其中:
<browsers>
<browser refID="GenericDownlevel">
<capabilities>
<capability name="cookies" value="true" />
</capabilities>
</browser>
</browsers>
2.在您的web.config中强制Cookieless = UseCookies (2. Force Cookieless=UseCookies in your web.config)
Add cookieless="UseCookies" for your forms element in web.config.
在web.config中为表单元素添加cookieless =“ UseCookies”。
<authentication mode="Forms" >
<forms loginUrl="~/Account/LogOn" timeout="2880" cookieless="UseCookies" />
</authentication>
Hope this helps.
希望这可以帮助。