如何更改会话超时? [英] How do I change the session timeout?

查看:77
本文介绍了如何更改会话超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过了:

< sessionState timeout =" 1">

< / sessionState>


反弹IIS,1分钟后还有一个会话。


???


-

谢谢 - dave

david_at_windward_dot_net
http://www.windwardreports.com


小隔间战争 - http ://www.windwardreports.com/film.htm

I tried:
<sessionState timeout="1">
</sessionState>

bounced IIS, and after 1 minute still had a session.

???

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

推荐答案

David Thielen写道:
David Thielen wrote:

我试过:

< sessionState timeout =" 1">

< / sessionState>


反弹IIS,1分钟后还有一个会话。


???
I tried:
<sessionState timeout="1">
</sessionState>

bounced IIS, and after 1 minute still had a session.

???



仅限IIS每分钟清除一次旧会话,所以会议将会花费两分钟es。


-

G ??跑安德森

_____
http://www.guffa.com


嗨Dave,


对于ASP.NET SessionState,超时设置是< sessionStateelement的timeout

属性:

#sessionState元素
http: //msdn2.microsoft.com/en-us/library/h6bb9cz9.aspx

至于会话超时行为,您是如何找到会话的?br / >
还没有超时。旧会话超时后,新的会话将启动。您是否检查过sessionID以验证是否已建立不同的

会话ID?

此致,


史蒂文Cheng


Microsoft MSDN在线支持主管


==================== ==============================

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx


==================================== ==============


此帖子按原样提供。没有保证,也没有赋予任何权利。


Hi Dave,

As for ASP.NET SessionState, the timeout setting does be the "timeout"
attribute of the <sessionStateelement:

#sessionState Element
http://msdn2.microsoft.com/en-us/library/h6bb9cz9.aspx

As for the session timeout behavior, how did you found that the session
hasn''t been timeout. When a old session has been timeout, a new one will be
started. Have you checked the sessionID to verify that a different
sessionID has been established?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.




re:

!你检查了吗? sessionID用于验证是否已建立不同的
!sessionID?

史蒂文,


SessionID存在问题, Internet Explorer和Firefox中包含的内容,如果在尝试创建新会话之前IE / Firefox的所有实例都没有关闭,那么
将会回收SessionID (将继续使用相同的SessionID)。


轻松复制:


1.在global.asax中创建会话开始时间变量:


Sub Session_OnStart()

Session.Contents(" SessionStartTime")=现在

结束子


2.创建一个测试页面,SessionID.aspx:

<%@ Page Language =" VB" %>

< html>

< head>

< / head>

<正文>

< script language =" VB" runat =" server">

Sub Page_Load(Sender As Object,E As EventArgs)

Response.Write(" Session ID:"& Session。 SessionID)

Response.Write("< br />")

Response.Write(" Session start time:"& Session(") ; SessionStartTime"))

End Sub

< / script>

< / body>

< ; / html>


3.将web.config中的会话超时设置为1分钟:


< sessionState mode =" InProc" ; Cookie的= QUOT假QUOT;超时= QUOT 1 QUOT; />


现在,关闭所有Internet Explorer / Firefox实例,除了一个和:


1.运行SessionID.aspx并注意会话ID和时间。


2. 1分1秒后刷新页面。


SessionID将是相同的,但是会话的开始时间会有所不同。

(SessionID被回收,但是有一个新的Session开始时间,所以有一个新的会话)


3.现在,关闭Internet Explorer / Firefox并运行同一页面。


SessionID将更改。


此行为必须在测试时要考虑因为,如果所有浏览器窗口都没有关闭,那么
,SessionID将是相同的

....即使存在新的会话。


我没有测试过其他浏览器,但怀疑,因为IE

和Firefox表现出相同的行为,同样的情况也会发生。 />

Juan T. Llibre,asp.net MVP

asp.net faq: http://asp.net.do/ faq /

foros de asp.net,en espa?ol: http://asp.net.do/foros/

====================== =============

" Steven Cheng [MSFT]" < st ***** @ online.microsoft.com写信息

新闻:wT ************** @ TK2MSFTNGHUB02.phx.gbl ...
re:
!Have you checked the sessionID to verify that a different
!sessionID has been established?
Steven,

There is an issue with SessionID, Internet Explorer and Firefox which consists in that,
if all instances of IE/Firefox aren''t closed before attempting to create a new session,
the SessionID will be recycled ( the same SessionID will continue to be used ).

Easy repro :

1. Create a Session start time variable in global.asax:

Sub Session_OnStart()
Session.Contents("SessionStartTime") = Now
End Sub

2. Create a test page, SessionID.aspx :
<%@ Page Language="VB" %>
<html>
<head>
</head>
<body>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Response.Write("Session ID : " & Session.SessionID)
Response.Write("<br />")
Response.Write(" Session start time : " & Session("SessionStartTime"))
End Sub
</script>
</body>
</html>

3. Set the session timeout in web.config to 1 minute :

<sessionState mode="InProc" cookieless="false" timeout="1" />

Now, close all instances of Internet Explorer/Firefox, except one and :

1. Run SessionID.aspx and note the Session ID and the time.

2. After 1 minute and 1 second, refresh the page.

The SessionID will be the same, but the Session start time will be different.
( The SessionID was recycled, but there is a new Session start time, so there''s a new session )

3. Now, close Internet Explorer/Firefox and run the same page.

The SessionID will change.

This behavior must be taken into consideration when testing because,
if all browser windows aren''t closed, the SessionID will be the same
....even though a new session exists.

I haven''t tested other browsers, but suspect that, since IE
and Firefox exhibit the same behavior, the same will happen.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espa?ol : http://asp.net.do/foros/
===================================
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:wT**************@TK2MSFTNGHUB02.phx.gbl...

嗨Dave,


对于ASP.NET SessionState,超时设置确实是超时
属性:

#sessionState元素
http://msdn2.microsoft.com/en-us/library/h6bb9cz9.aspx


至于会话超时行为,你是怎么发现会话

还没有超时。旧会话超时后,新的会话将启动。您是否检查过sessionID以验证是否已建立不同的

会话ID?

此致,


史蒂文Cheng


Microsoft MSDN在线支持主管


==================== ==============================

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx


==================================== ==============


此帖子按原样提供。没有保证,也没有授予任何权利。


Hi Dave,

As for ASP.NET SessionState, the timeout setting does be the "timeout"
attribute of the <sessionStateelement:

#sessionState Element
http://msdn2.microsoft.com/en-us/library/h6bb9cz9.aspx

As for the session timeout behavior, how did you found that the session
hasn''t been timeout. When a old session has been timeout, a new one will be
started. Have you checked the sessionID to verify that a different
sessionID has been established?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.




这篇关于如何更改会话超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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