简体   繁体   中英

Session Timeout in Classic ASP website

Where does classic ASP store the value for session timeout? I have looked through the code and this classic ASP website isn't using Global.asa(so no "Session_OnStart") or Session.timeout=x. The website is hosted on IIS 7.On IIS for this website,in Features view,double-clicking on "ASP" -> Session Properties -> Enable session is set to 'True' and the Time-out value is set to 20. The problem is: though the session time-out is set to 20 mins. on IIS,it times out after 5 minutes. Is there any other way/place to modify the session timeout value for this classic ASP website?

Can someone help me with this please?

Edit: I looked at the settings for the application pool.The Idle time-out is 20 mins. and Recycling->Regular Time Interval is set to 1740.

Following on from my comments, your Recycling settings need to be set like the following image to make sure the Application Pool will not be reset.

IIS 7+中的回收设置

It's also worth setting the "Generate Recycle Event log Entry" so you can see what events are causing your Application Pool to reset. That way you can monitor it in the Event Viewer.

在此输入图像描述


Useful Links

You can do it 2 way.

  1. Put global asa file into root of your site and define session time out there

  2. You can introduce following line on top of each of the pages in question (if you not using include header)

     <% Session.Timeout=20 Server.ScriptTimeout=1200 %> 

20 is been period in minutes and 1200 is same period in seconds. Keep in mind that server takes a seconds not a minutes!!! By default IIS terminates any script if it runs longer then 90 seconds.

If you using include file as a header then you will need to do it only once there, on the top of the page right after option explicit. and assuming that you already did disabled all app pool defaults as what @Lankymart suggested.

In IIS7, click on your site, double click ASP, then expand the Limits Properties. You will then see a Script Time-out setting in HH:MM:SS format. Set that and it should fix things.

Source: http://technet.microsoft.com/en-us/library/bb632464.aspx

Have you looked at the web.config file? I am not a classic asp expert, but in asp.net you can also set session state in the file like so:

<sessionState mode="InProc" cookieless="false" timeout="60"></sessionState>

You may want to verify 2 things.

1.) That you app pool is not recycling too often.

2.) What I mentioned above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM