Session.Timeout被忽略 [英] Session.Timeout being ignored

查看:92
本文介绍了Session.Timeout被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的global.asa文件中使用以下代码来设置

session.timeout值等等 -


Sub Session_OnStart

Session.Timeout = 40

Session(Authenticated)= 1

End Sub


然而,当我在这个

事件被触发后打印出session.timeout的值时,它返回20(我得到正确的价值

Session(& ;经过身份验证的)所以我的代码似乎正常工作了。


我检查了服务器上IIS(v5)中的默认超时值,但

这个读取900秒,在我的书中是15分钟。因为这个20的价值来自哪里,所以我非常感到困惑。

任何人都可以指出我正确的方向,因为我需要将其设置为

40分钟,我的WROX手册没有提供关于这个

财产的更多信息。


TIA,


Colin

解决方案

为什么不在IIS中设置它,而不是为每个会话设置它?


-

Aaron Bertrand

SQL Server MVP
http://www.aspfaq.com/


" Colin Steadman" <去**** @ colinsteadman.com>在消息中写道

news:40 ************************** @ posting.google.c om ...

我在我的global.asa文件中使用以下代码来设置
session.timeout值以及其他内容 -

Sub Session_OnStart Session.Timeout = 40
会话(Authenticated)= 1
End Sub

然而,当我在此页面之后打印出session.timeout的值时br />事件已经触发它返回20(我得到了正确的值
Session(Authenticated),所以我的代码似乎正常工作)。

我检查了默认的超时值在服务器上的IIS(v5)中,但是这读取了900秒,在我的书中是15分钟。因此,我很困惑这个20的价值来自哪里。
任何人都可以指出我正确的方向,因为我需要将其设置为40分钟而且我的WROX手册没有没有提供关于这个
属性的大量信息。

TIA,

Colin



< blockquote> Aaron Bertrand - MVP于2004年1月5日在

microsoft.public.inetserver.asp.general写道:

为什么不在IIS中设置它,而不是为每个单独的会话设置它?




Aaron,

很多人无法访问IIS设置,

愉快地使用虚拟服务器。


也许它可以在Application_onStart中设置?


-

Evertjan。

荷兰。

(请在我的电子邮件地址中将x'变为点数)


> Aaron,

我们很多人无法访问IIS设置,很高兴使用虚拟服务器。




我明白这一点。我只是建议它,因为他说:


我检查了服务器上IIS(v5)中的默认超时值,


这让我相信他有权访问。


I''m using the following code in my global.asa file to set the
session.timeout value amongst other things -

Sub Session_OnStart
Session.Timeout = 40
Session("Authenticated") = 1
End Sub

Yet when I print out the value of session.timeout on a page after this
event has fired it returns 20 (I get the right value for
Session("Authenticated") so my code appears to be working).

I checked the default timeout value in IIS (v5) on the server, but
this reads 900 seconds, which in my books is 15 minutes. I am
therefore very confused as to where this value of 20 is coming from.
Could anyone point me in the right direction as I need to set this to
40 minutes and my WROX manual doesn''t provide much information on this
property.

TIA,

Colin

解决方案

Why don''t you set it in IIS, instead of setting it for every single session?

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Colin Steadman" <go****@colinsteadman.com> wrote in message
news:40**************************@posting.google.c om...

I''m using the following code in my global.asa file to set the
session.timeout value amongst other things -

Sub Session_OnStart
Session.Timeout = 40
Session("Authenticated") = 1
End Sub

Yet when I print out the value of session.timeout on a page after this
event has fired it returns 20 (I get the right value for
Session("Authenticated") so my code appears to be working).

I checked the default timeout value in IIS (v5) on the server, but
this reads 900 seconds, which in my books is 15 minutes. I am
therefore very confused as to where this value of 20 is coming from.
Could anyone point me in the right direction as I need to set this to
40 minutes and my WROX manual doesn''t provide much information on this
property.

TIA,

Colin



Aaron Bertrand - MVP wrote on 05 jan 2004 in
microsoft.public.inetserver.asp.general:

Why don''t you set it in IIS, instead of setting it for every single
session?



Aaron,
lots of us have no access to IIS settings,
happily using virtual servers.

Perhaps it could be set in Application_onStart ?

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


> Aaron,

lots of us have no access to IIS settings,
happily using virtual servers.



I understand that. I only suggested it, because he said:

"I checked the default timeout value in IIS (v5) on the server,"

Which leads me to believe he DOES have access.


这篇关于Session.Timeout被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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