ios中mvc的FormsAuthentication.SetAuthCookie(cookieUserName, false)失败
2016-08-19 10:33
441 查看
如果楼主使用.net开发,要注意FormsAuthentication.SetAuthCookie 方法的使用会导致ios出现该问题。
因为这个方法在ios设备上是把票据加入到url中,导致url和你的授权目录不匹配。
解决办法:
Web配置文件中的forms节点的cookieless属性设置为“UseCookies”
例如:
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" name=".aspnet" cookieless="UseCookies" />
</authentication>
因为这个方法在ios设备上是把票据加入到url中,导致url和你的授权目录不匹配。
解决办法:
Web配置文件中的forms节点的cookieless属性设置为“UseCookies”
例如:
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" name=".aspnet" cookieless="UseCookies" />
</authentication>
相关文章推荐
- asp.net mvc 中[Authorize]在IE9以上版本关于FormsAuthentication.SetAuthCookie无效的问题 解决方案
- MVC .NET的FormsAuthentication.SetAuthCookie在IE10中无效的问题
- FormsAuthentication.SignOut(); FormsAuthentication.SetAuthCookie(u.UserName, false);
- Asp.net MVC Form认证,IIS改成集成模式后,FormsAuthentication.SetAuthCookie无效,Request.IsAuthenticated值,始终为false,页面提示HTTP 错误 401.0 - Unauthorized,您无权查看此目录或页面
- FormsAuthentication.SetAuthCookie Method
- FormsAuthentication.SetAuthCookie
- asp.net 登陆验证 Form表单验证的3种方式 FormsAuthentication.SetAuthCookie;FormsAuthentication.RedirectFromLoginPage;FormsAuthenticationTicket
- asp.net 登陆验证 Form表单验证的3种方式 FormsAuthentication.SetAuthCookie;FormsAuthentication.RedirectFromLoginPage;FormsAuthenticationTicket
- asp.net 登陆验证 Form表单验证的3种方式 FormsAuthentication.SetAuthCookie;FormsAuthentication.RedirectFromLoginPage;FormsAuthenticationTicket
- FormsAuthentication.SetAuthCookie 方法 (String, Boolean)
- 自己实现FormsAuthentication.SetAuthCookie方法,怎样在ASP.NET服务端代码中删除客户端Cookie
- FormsAuthentication.SetAuthCookie
- FormsAuthentication.SetAuthCookie
- FormsAuthentication.SetAuthCookie 方法登录
- FormsAuthentication.SetAuthCookie
- FormsAuthentication.SetAuthCookie函数使用无效
- FormsAuthentication.SetAuthCookie Method
- MVC4 Forms 验证,部署到Hyper-v上.FormsAuthentication.SetAuthCookie无效的问题
- FormsAuthentication.SetAuthCookie是必须写的吗?
- asp.net 登陆验证 Form表单验证的3种方式 FormsAuthentication.SetAuthCookie;FormsAuthentication.RedirectFromLoginPage;FormsAuthenticationTicket