您的位置:首页 > 其它

web.config设置Cookies过期时间

2008-03-11 09:11 330 查看
写法:

代码配合web.config的写法,

代码中写直接用 :FormsAuthentication.SetAuthCookie(gUserId, true);//gUserId登陆id

如果用这种写法,需在config中进行相应配置,配置如下:

<authentication mode="Forms">
<forms name=".DeskTopUser" protection="All" timeout="90" loginUrl="login.aspx" path="/" defaultUrl="EmployeEditList.aspx"/>
</authentication>

timeOut所表示的时间是过期时间,以分钟为单位
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: