您的位置:首页 > 产品设计 > UI/UE

cookie 跟 Request.IsAuthenticated 之间是什么关系

2013-05-21 11:37 239 查看
Request.IsAuthenticated是根据web.config中的cookie设置进行判断的,比如:

<authentication mode="Forms">
<forms name="cookieName" loginUrl="login.aspx" protection="All" timeout="43200" path="/" />
</authentication>


使用Forms验证,登录后写cookie的代码很简单:

FormsAuthentication.SetAuthCookie(username, true);


这里的cookie设置也是由web.config中的设置决定的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: