session not working in classic asp on iis server 8

怎甘沉沦 提交于 2020-01-15 12:16:08

问题


My Session variable isn't initialising in classic asp webPages which is hosted on iis server 8, I have already configured the Session properties in session state feature view as well as in the Debugging Properties of ASP section of IIS server 8,

please help me i m facing this problems after shifting my whole website from Windows server 2008 r2 with IIS7 to Windows server 2012 r2 with IIS8

on IIS 7 i haven't face any issue regarding this session variables initialiasation

any help,would be appriciated

Thanks in Advance


回答1:


You need to enable session state under classic asp in IIS7/IIS8.

Open IIS Manager. Navigate to the site you are working on. On the right double click ASP. Click on Session properties + to show all options. Change enable session state to true.




回答2:


Try this code to make sure the variables aren't being initialising:

dim i
dim j
j = Session.Contents.Count
Response.Write("Session variables: " & j & "<br>") 
For i=1 to j
  Response.Write(Session.Contents(i) & "<br>") 
Next

The code above will show you if there is any variable being initialized and the content of each one.




回答3:


If session state is ok in the IIS settings, check to make sure that you didn't use session.Abandon() because when this method is called, the current Session object is not deleted until all of the script on the current page have been processed. This means that it is possible to access session variables on the same page as the call to Abandon, but not from another Web page and not when you plan to transfer data between two pages by using the session object.




回答4:


I have a same problem.In my case website has no cookie. I do not use SSL certificate for my websie and exist <httpCookies requireSSL="true" /> code inside system.web section . after I change this to <httpCookies requireSSL="false" /> my problem solved.



来源:https://stackoverflow.com/questions/16207195/session-not-working-in-classic-asp-on-iis-server-8

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