IIS 7 Classic ASP session for website, website subdirectory, application inside website

旧街凉风 提交于 2019-12-12 03:23:33

问题


Environment: Win server 2008 R2, IIS 7.5

Website:

MainWebsite

MainWebsite\Subdirectory

MainWebsite\VirtualDirectory

For MainWebsite - ASP -> (Session Properties) -> Time-Out -> 00:04:00

For MainWebsite\Subdirectory -> ASP -> (Session Properties) -> Time-Out -> 00:08:00

AppPool -> (Process Model) -> Idle Time-Out (minutes) -> 10 [I set it to 10 minute]

Requirement:

I want the MainWebsite to hold the session for 4 minutes.

I want the MainWebsite\Subdirectory to hold the session for 8 minutes.

The above configuration is kind of a tiny test I am doing, so I could replace the time-out values with 20 mintues or 30 mintues on my real prod environment.

The issue is, the Session time out setting for the "Mainwebsite\subdirectory" is not effective. Though it is set to 8 minutes, the session is lost after every 4 minutes, where 4 minutes is the setting of the MainWebsite.

Is this the expected behaviour, then I dont understand why there is an option to configure the ASP Session Timeout on a subdirectory level.

Let me know if you need more information. Appreciate your comments.


回答1:


Since this is being done in IIS it does make sense how it's working. Your timing out the whole site including the subdirectories before the subdirectory is timed out. The reason you can set it is if you want to time out the sub directory before the main level. I would recommend using asp code to timeout the session. You can set it in your global.asa so it's done at the global level for each session.

<%
Session.Timeout = 40
%>

where 40 = the number of minutes.

Reference: http://classicasp.aspfaq.com/general/how-do-i-increase-timeout-values.html



来源:https://stackoverflow.com/questions/8499910/iis-7-classic-asp-session-for-website-website-subdirectory-application-inside

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