会话状态stateserver或Sql Server [英] Session State stateserver or Sql Server

查看:81
本文介绍了会话状态stateserver或Sql Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用默认会话状态(InProc)并且发现我

一段时间后一直在丢失我的信息(通常是20

分钟) 。


无论如何都要知道我有多少时间参加会议?


如果我刷新,会重置会话时钟?


您是否必须转到另一个页面来重置会话超时或

a回发也会这样做?这很重要,因为我们有一些页面,用户将会留在他将要做各种提交的地方,这将只会做

回发(所以页面没有不要改变。如果突然超时期限到来并且用户没有离开页面,那么这可能是一个问题。突然间,我收到一个错误,说明会话变量是空白的。


我正在考虑切换状态服务器或Sql Server模式,但我不确定这些缺点。大多数书都对不同的

模式有了一点了解,但对利弊没什么了解。


一个问题是 - 我的代码是否仍然有用设置和

阅读会话变量一样吗?


谢谢,


Tom

I have been using the default session state (InProc) and have found that I
have been loosing my information after a period of time (normally 20
minutes).

Is there anyway to find out how much more time I have on a session?

If I do a refresh, does reset the session clock?

Do you have have to go to another page to reset the session timeout or will
a postback also do it? This is important as we have a few pages that a user
will stay on where he will be doing all kinds of submits that will just do
Postbacks (so the page doesn''t change). This could be a problem if all of a
sudden the timeout period comes up and the user has not left the page. All
of a sudden, I get an error that says the session variable is blank.

I am thinking of switching ot State Server or Sql Server mode, but am not
sure of the drawbacks. Most of the books give a small idea of the different
modes but not much on the pros and cons.

One question is - does my code still work the same as far as setting and
reading session variables?

Thanks,

Tom

推荐答案

具有会话亲和性的单个框或Web场上的StateServer

将摆脱使用InProc的定期会话丢失。 />

阅读这些,他们会很有帮助


ASP.NET会话常见问题

http://www.eggheadcafe.com/articles/20021016.asp


关于StateServer如何提供帮助的更多信息

http://www.eggheadcafe.com/articles/20030416.asp

更好地管理InProc的可选软件
$ b Web场外ASP.NET的$ b会话状态。
http://www.eggheadcafe.com/articles/scaleout_server.asp

-

2004和2005 Microsoft MVP C#

Robbe Morris
http://www.masterado.net


赚取
StateServer on a single box or a web farm with session affinity
will get rid of your periodic session loss with InProc.

Read these, they''ll be helpful

ASP.NET Session FAQ

http://www.eggheadcafe.com/articles/20021016.asp

More info on how StateServer might help

http://www.eggheadcafe.com/articles/20030416.asp

Optional software to better manage InProc
session state outside of ASP.NET in a web farm.

http://www.eggheadcafe.com/articles/scaleout_server.asp

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn


钱回答.NET Framework

EggHeadCafe.com上的留言板帖子。 /> http://www.eggheadcafe.com/forums/merit.asp


" tshad" < TS ********** @ ftsolutions.com>在消息中写道

新闻:OQ ************** @ TK2MSFTNGP10.phx.gbl ...
money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

"tshad" <ts**********@ftsolutions.com> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
我一直在使用默认会话状态(InProc)并且发现我在一段时间后(通常是20
分钟)丢失了我的信息。

无论如何都要知道如何我有更多的时间参加会议吗?

如果我刷新,会重置会话时钟吗?

您是否必须转到另一个页面重置会话?超时或
回发也会这样做吗?这很重要,因为我们有一些页面,用户将留在他将要做各种提交的地方,这将只做回发(所以页面不会改变)。这可能是一个问题
如果突然出现超时时间并且用户没有离开页面。突然间,我得到一个错误,说会话变量
是空白的。

我正在考虑切换状态服务器或Sql Server模式,但我不确定
缺点。大多数书籍都提供了不同模式的小概念,但没有多少关于利弊。

一个问题是 - 我的代码在设置方面仍然有效吗?读取会话变量?

谢谢,

Tom
I have been using the default session state (InProc) and have found that I
have been loosing my information after a period of time (normally 20
minutes).

Is there anyway to find out how much more time I have on a session?

If I do a refresh, does reset the session clock?

Do you have have to go to another page to reset the session timeout or
will a postback also do it? This is important as we have a few pages that
a user will stay on where he will be doing all kinds of submits that will
just do Postbacks (so the page doesn''t change). This could be a problem
if all of a sudden the timeout period comes up and the user has not left
the page. All of a sudden, I get an error that says the session variable
is blank.

I am thinking of switching ot State Server or Sql Server mode, but am not
sure of the drawbacks. Most of the books give a small idea of the
different modes but not much on the pros and cons.

One question is - does my code still work the same as far as setting and
reading session variables?

Thanks,

Tom



tshad写道:
我一直在使用默认会话状态(InProc)并且发现我在一段时间后(通常是20分钟)失去了我的信息。

无论如何要知道我有多少时间在一个会话上?

如果我刷新,会重置会话时钟吗?

你是必须转到另一个页面重置会话超时或者回复也会这样做吗?这很重要,因为我们有一些页面,用户将继续留在他将进行各种提交的地方,这将只做回发(因此页面不会改变)。如果所有突然超时时间到来并且用户没有离开页面,这可能是一个问题。突然间,我得到一个错误,说会话变量是空白的。

我正在考虑切换状态服务器或Sql Server模式,但我不确定
缺点。大多数书都对不同的模式有了一点了解,但对利弊没什么了解。

一个问题是 - 我的代码在设置方面仍然有效吗?读取会话变量?

谢谢,

Tom
I have been using the default session state (InProc) and have found that I
have been loosing my information after a period of time (normally 20
minutes).

Is there anyway to find out how much more time I have on a session?

If I do a refresh, does reset the session clock?

Do you have have to go to another page to reset the session timeout or will
a postback also do it? This is important as we have a few pages that a user
will stay on where he will be doing all kinds of submits that will just do
Postbacks (so the page doesn''t change). This could be a problem if all of a
sudden the timeout period comes up and the user has not left the page. All
of a sudden, I get an error that says the session variable is blank.

I am thinking of switching ot State Server or Sql Server mode, but am not
sure of the drawbacks. Most of the books give a small idea of the different
modes but not much on the pros and cons.

One question is - does my code still work the same as far as setting and
reading session variables?

Thanks,

Tom




任何请求导致会议重置其柜台;即滑动到期时间为

。如果你想知道剩下的时间(对于

知道它确实重置了它的计时器之后的某些原因),你必须设置

你自己的Session变量保持当前时间,完成后设置

处理和响应设置为客户端。然后你必须在下一个请求上做

数学....但对我来说用处不大,除非你想知道
你知道你有多接近超时......


当你想在webserver重启时坚持

会话时,SqlServer和StateServer非常有用;它将会话信息存储在另一个

服务器上(或进程外)。

你自己如何调用变量没有明显区别...


-

Craig Deelsnyder

Microsoft MVP - ASP / ASP.NET



Any requests cause the Session to reset its counter; i.e. it is a
sliding expiration. If you wanted to know the amount of time left (for
some reason after knowing it does reset its timer), you''d have to set
your own Session variable to hold the current time, set it when done
processing and response is set to client. Then you''d have to do the
math on the next request....but not much use to me, unless you want to
know how close you came to timing out...

SqlServer and StateServer are useful for when you want to persist the
session across webserver restarts; it stores the Session info on another
server (or out of process). There''s no discernible difference in how
you would call variables themselves...

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET


这篇关于会话状态stateserver或Sql Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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