设置超时之前的ASP会话到期 [英] ASP session expiration before timeout setting

查看:95
本文介绍了设置超时之前的ASP会话到期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的某些遗留程序正在使用ASP(不是ASP.Net),即使我将长时间会话过期时间设置为例如20分钟,有时设置为短时间(例如几分钟),我仍然会注意到会话过期错误框–

Some of my legacy program is using ASP (not ASP.Net), and even if I set long session expire time, for example to 20 minutes, sometimes in short time (e.g. in several minutes) I will still notice session expire error box –

空闲时间过多,请重新登录."

"too much idle time, please login again."

有什么想法需要进一步分析吗?不确定是我的代码错误还是服务器(浏览器)配置问题,因为并非所有客户端/服务器组合都遇到此奇怪的问题.

Any ideas to analyze further? Not sure whether it is my code bug or server (browser) configuration issue, since not all client/server combinations are met with this strange issue.

会话过期框由我的代码触发:

The session expire box is triggered by my code:

<%
    if session("timeToken") = "" then
%>

<script language = "JavaScript">
<!--
window.alert ("too much idle time, please login again");
//-->
</script>
<%
response.End()
end if
%>

推荐答案

基于您的更新的一些想法:

A couple of ideas based on your update:

  1. 您的session("timeToken")是否为空还有其他原因吗?另一个地方的代码片段或变量在某个地方的拼写错误?

  1. Is there another reason your session("timeToken") could be empty? Another piece of code somewhere or perhaps the variable was misspelled somewhere?

session("timeToken")的实际值在您的代码中如何变化?会话开始时是否已设置?是否定期更新?它存储什么值?

How does the actual value of session("timeToken") change in your code? Is it set when the session starts? Is it updated periodically? What value does it store?

您编写的代码似乎很好,因此,如果这不是代码问题,则可能是真正的会话问题……只是一些需要首先检查的事情.

The code you've written seems to be fine, so if it's not a code issue it will likely be a genuine session problem... just some things to check first.

更新:

  • ASP会话状态通常使用Cookie维护-您可以检查客户端是否启用了Cookie吗?
  • ASP应用程序是否由多台服务器提供服务?如果是从Web场或群集中进行服务,则需要确保会话状态可以在计算机上持续存在,或者用户的会话处于粘性"状态-也就是说,它始终由同一台服务器提供服务.

更多信息和帮助可以在这里找到: http://msdn. microsoft.com/en-us/library/ms972338.aspx

More information and help can be found here: http://msdn.microsoft.com/en-us/library/ms972338.aspx

这篇关于设置超时之前的ASP会话到期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆