How to establish a session never expires in ASP

I am using ASP classic (1.1) with IIS 6.0. Are there any options for setting a session to never expire?

thanks in advance George

+3
source share
2 answers
Session.Timeout=5 

It will mean that it expires in 5 minutes. I do not think you can set it to infinity, but you can set it to about a large amount.

+3
source

You can specify the value of Session.Timeout in minutes. Either your pages are polling the server every n minutes (the javascript function will do this, or you can have a dummy iframe with updated content to call a dummy asp page every n minutes).

This is better (although polling may be taxed on your server, do not poll too often) because if you set the session timeout to a very high (or infinite ...) value, you will end up with an asp error with an out-of-memory error (I think the application pool will be restarted).

A session is stored in memory when the user calls up any asp page in the application until the timeout expires. If your user closes his browser, you will not be notified of your application, and asp will have to wait until the timeout clears the memory. This means that the session will remain in memory for n minutes after the user leaves, n will be a timeout.

There is no need to have an endless session (it can be solved by polling), and setting using the timeout parameter will make your application more fragile.

If you want to store information for a long time (mainly, for the entire life of your application), you are better off using the Application object, which is a dictionary similar to a session, but is singleton and can be accessed by any user on the server.

+2
source

Source: https://habr.com/ru/post/1285757/


All Articles