0

I am using MVC3, and I am trying to do a login page. I am storing all my details in the session. If I press 'login' again, it will show the values as being in the session. When I load another page, or reload the login page, the session is empty. I have made sure there's no code anywhere in my application that could be clearing the session. I've found online articles about doing what I am doing, so it seems it should work ? I've set breakpoints in my session_start in app_config, and it's only called the once per session.

Just to add, if I look at the session object, the session id is the same. Two values are put in the session in the controller, and then 10 or so in the AJAX call. When I reload the same page, only the 2 values are in the controller, but the AJAX call could see those two values. So, the AJAX call could see the existing session, but the values it adds, are visible if I make the same AJAX call over and over, but gone from a page load.

4

1 回答 1

0

据我所知,卡西尼有时会彻底失败。我发现一些谷歌参考表明这是真的,虽然失败是一致的(我可以看到我的会话值,直到我到达授权页面),在我尝试在 IIS 中运行它(这不起作用)之后,它开始在卡西尼工作。无论如何,我最终放弃了这种机制,但是,如果您有同样的问题,我建议您不能信任 Visual Studio 附带的 Web 服务器。

于 2012-10-31T03:49:50.920 回答