Session variable empty in iis7 application

試著忘記壹切 提交于 2020-01-06 08:06:32

问题


I have an asp.net application that uses ajax. I want to be able to pass data from one page to another so I store what I want in a session variable and redirect the response to the destination page where i retrieve what i want for further processing. I use:

Response.Redirect(path, false)

Everything works fine until I try to publish to my staging iis7 server. My session variable always returns empty. But if I try to navigate to the page from within the iis server itself (via right click on the page in iis and clicking explore) it works well and the session variable value is retained. It only does it when I am accessing the iis application from my browser. Everything else works well like loadin pages, controls, the redirect. It is only that the session variables result to empty.


回答1:


This can happen when the application pool is misconfigured, like for example if you set the number of worker processes to more than one.

Another common cause of this issue is when the server name contains underscores (e.g. DEV_TEST). Underscores aren't allowed as host names, and could interfere with the ability to set cookies.



来源:https://stackoverflow.com/questions/8094840/session-variable-empty-in-iis7-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!