【发布时间】:2011-07-15 23:27:54
【问题描述】:
如果超时,有没有办法创建一个新会话?在 移动应用开发 中使用 asp.net?
收到此错误:
the page requires session state that is no longer available. either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. try increasing the history size or session expiry limit
这就是我的 web.config 中的内容:
<sessionState cookieless="UseCookies" cookieName="Mobile_Session" regenerateExpiredSessionId="true">
</sessionState>
【问题讨论】:
-
从技术上讲,一旦超时,服务器会自动为同一个用户生成一个新的会话,因为它把用户当作一个新的访问者。您可以通过将会话选项设置为使用“无 cookie 会话”来测试这一点,并查看 URL 如何随时间变化。我猜您正在考虑保留会话或恢复会话,下面有一些很好的答案。
-
我稍微整理了一下我的答案。如果您仍然遇到问题,可能需要一些上下文。希望对您有所帮助!
标签: asp.net mobile-website mobile-phones