并登录后,ASP .NET届复位? [英] Does ASP .NET Session reset after login?

查看:211
本文介绍了并登录后,ASP .NET届复位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

修改

此问题似乎已经消失奇怪。这里一定是我的环境时髦的东西。我投票,关闭了这个问题。

This problem seems to have strangely disappeared. There must've been something funky with my environment. I'm voting to close this question.

当用户登录时,我从登录页面code-后面一组数据夸大了会议。然后,我将用户重定向到应用程序中的不同页面。我也有一些该会话恢复逻辑重新膨胀的基础上的身份验证票证当用户的会话过期的会话。

When a user logs in, I inflate the session with a bunch of data from the Login page code-behind. Then I redirect the user to a different page in the application. I also have some session recovery logic which re-inflates the session based on the auth ticket when the user's session expires.

什么似乎是发生的是,我夸大了用户的会话从登录页面一组数据,然后重定向他们,我重定向似乎对页面请求他们不具备会话,因此,应用程序必须重新它充气。我不明白这一点 - 我看着饼干和会话ID并没有改变,我不是在code随时随地复位会话数据。这是一个ASP .NETfeauture?我使用ASP .NET 4.0。

What seems to be happening is that I inflate the user's session with a bunch of data from the login page, then redirect them, and the request for the page to which I redirect them doesn't seem to have the session, so the application has to re-inflate it. I don't understand this - I've looked at the cookie and the session ID is not changing, and I am not resetting the session data anywhere in the code. Is this an ASP .NET 'feauture'? I'm using ASP .NET 4.0.

编辑:

要澄清:登录请求(在点击连的登录按钮)在会议期间充气。在接下来的请求时,它不会出现在会议中填充任何更长的时间,所以我最终不得不重新膨胀的会话。该用户之后,使任何请求,会话似乎大棒,我有后续请求的适当充气会话。

To clarify: The session is inflated during the login request (on the click even of the login button). During the next request, it doesn't appear the session is populated any longer, so I end up having to re-inflate the session. Any requests that user makes after that, the session seems to "stick" and I have the properly inflated session for subsequent requests.

推荐答案

要回答你的问题 SessionState会数据是独立的登录/注销的。

To answer your question SessionState data is independent of login/logout.

有几个原因,数据可能从 SessionState会

There are several reasons why data might "disappear" from SessionState.


  • 如果您使用的是是InProc SessionState会在Web场上,用户可能有后续请求被送达在不同的机器的农场。

  • SessionState会可以清除,如果它变得太满(如高速缓存)。

  • 如果您使用的是自定义的 SessionStateStoreProvider ,也可以不被保存/检索 SessionState会正常。

  • If you are using InProc SessionState on a web farm, the user may have a subsequent request be served by a different machine in the farm.
  • SessionState can clear if it gets too full (like a cache).
  • If you are using a custom SessionStateStoreProvider, it may not be saving/retrieving the SessionState properly.

这篇关于并登录后,ASP .NET届复位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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