写法:

      代码配合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所表示的时间是过期时间,以分钟为单位

posted on 2008-03-11 09:11  星答  阅读(4097)  评论(2编辑  收藏  举报