表单身份验证在MVC 4中不使用coockies [英] Form Authentication In MVC 4 without using coockies

查看:138
本文介绍了表单身份验证在MVC 4中不使用coockies的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要对MVC 4中的表格认证提出紧急要求而不使用coockies。



请帮帮我。





谢谢

We Need Urgent Requirement on Form Authentication In MVC 4 without using coockies.

Please help me out.


Thank you

推荐答案

网络是无状态的,因此它使用cookie来存储状态,例如用户是否经过身份验证或不。如果您想使用没有cookie的表单身份验证,那么您可以启用cookieless身份验证



https://msdn.microsoft.com/en-us/library/system.web.configuration.formsauthenticationconfiguration.cookieless(v = vs.110).aspx [ ^ ]



将模式设置为UseUri。但是这有不利之处



https: //msdn.microsoft.com/en-us/library/aa479315.aspx [ ^ ]



除了使用基本身份验证或Windows身份验证之外,您唯一的另一种选择是不使用表单身份验证。还有一个选择就是挑战为什么你不能使用cookies作为这个决定背后的原因可能是有缺陷的。
The web is stateless so it uses cookies to store state such as if the user is authenticated or not. If you want to use forms authentication without cookies then you can enable cookieless authentication

https://msdn.microsoft.com/en-us/library/system.web.configuration.formsauthenticationconfiguration.cookieless(v=vs.110).aspx[^]

Set the mode to UseUri. However there are downsides to this

https://msdn.microsoft.com/en-us/library/aa479315.aspx[^]

Your only other alternative is to not use forms auth at all but use Basic Authentication or Windows Authentication. Yet one more option would be to challenge why you can't use cookies as the reasoning behind that decision is probably flawed.


这篇关于表单身份验证在MVC 4中不使用coockies的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆