写法:

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

相关文章:

  • 2021-08-10
  • 2022-12-23
  • 2021-09-05
  • 2021-08-26
  • 2021-07-09
  • 2022-02-18
  • 2021-07-24
  • 2021-09-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2021-06-29
  • 2022-12-23
相关资源
相似解决方案