难道ASP.NET的WebMethod请求计数会话时间? [英] Does ASP.NET WebMethod request count for session time?

查看:150
本文介绍了难道ASP.NET的WebMethod请求计数会话时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个加载页面,然后做所有的工作由一个的WebMethods ASP.NET应用程序。所以很长一段时间用户没有刷新页面。我认为,经过一段时间的会话打超时和会话变量被清除,因为每N分钟至少一个的WebMethod请求(N小于查看Session.Timeout)。真的吗?有没有办法来改变这种行为,不增加超时值。

I have an ASP.NET application which loads a page and then does all of the work by WebMethods. So for a long time the user does not refresh the page. I think after a while the session hits the timeout and session variables are cleared, because there is at least one WebMethod request at every N minutes (N is less than Session.TimeOut). Is that true? Is there a way to change this behaviour without increasing the TimeOut value..

推荐答案

我发现这个信息<一个href=\"http://www.velocityreviews.com/forums/t645068-static-page-methods-and-session-timeouts.html%3a\"相对=nofollow>在这里:

除非您使用异步回发将不能保持会话的存活
  cookie会话。如果使用的是基于cookie的会话(该
  默认情况下),那么超时是在cookie中。 Ajax调用不能更新
  这个cookie在浏览器中。由于会话超时逻辑要求
  发送一个新的cookie并取回对重定向,Ajax调用失败
  要做到这一点。

Async postbacks will not keep session alive unless you are using cookieless sessions. If you are using cookie based sessions (the default), then the timeout is in the cookie. Ajax calls can not update this cookie in the browser. As the session timeout logic requires sending a new cookie and getting back on redirect, the ajax calls fail to do this.

您可以切换到无会话的ajax调用(性能好主意)或访问Cookie会话

You could switch to sessionless for ajax calls (good performance idea) or go to cookieless sessions

这篇关于难道ASP.NET的WebMethod请求计数会话时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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