asp中设置session过期时间方法总结

2019-04-01 13:59:32丽君

  具体修改方法如下,在web.config中进行如下配置

  <system.web>
  <sessionState mode="InProc" timeout="30"/>
  </system.web>

  在这里指的是Session过期时间为30分钟。也就是说30分钟后如果当前用户没有操作,那么Session就会自动过期了。
  3、在调用Session的cs页中,Load事件里面写以下

  Session.Timeout = 30;

  4、Store session in asp.net state service

  <sessionState cookieless="false" timeout="480" mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" />

您可能感兴趣的文章:

几种判断asp.net中session过期方法的比较PHP中怎样保持SESSION不过期 原理及方案介绍php中实现精确设置session过期时间的方法Node.js编程中客户端Session的使用详解Node.js重新刷新session过期时间的方法