开发者

MVC lose session state?

开发者 https://www.devze.com 2022-12-12 04:45 出处:网络
Please forgive me for my poor English. This is driving me crazy. I\'m writing an application in ASP.NET MVC. Basically I have some pages which require to use session state. But now the session state l

Please forgive me for my poor English. This is driving me crazy. I'm writing an application in ASP.NET MVC. Basically I have some pages which require to use session state. But now the session state loses after the following code:开发者_如何学编程

...

Session["admin_ID"] = "aa27ec10-d9d4-43d9-96f6-7cfb0d5099ca";

...

After the following code, session states loses:

    [AcceptVerbs(HttpVerbs.Post)]
    public ActionResult GenerateVerifyModel(FormCollection formCollection)
    {
      ...
      return File(zipPath, "application/x-zip-compressed");
    }

Other code works very well and session state does not lose.

Any suggestion will be appreciated.


Shot in the dark: If you set something in the session and return a file, maybe the HTTP headers doesn't carry session's information... explaining the lost of the session on subsequent calls. But I would doubt it. Pretty hard to tell without a clearer scenario!

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号