When you start a new browser session and go to your site, classic ASP will detect that there is no ASP session cookie and will create a new session for you (as you already saw).
Session cookies are what they exist for the life of a session. When you close your browser, the session cookie will be deleted (even if your session state on the server will work as an orphaned session until the Session.Timeout expires - if you do not present the same session cookie during the Session.Timeout period).
The only way to extend the ASP session cookie lifetime in new browser sessions / instances is to change the cookie lifetime using a script in the browser / client.
If you want to manage the state between events, such as closing the browser, you will need to implement your own state management mechanism (for example, saving state in the database) and use a regular cookie with a long service life (or with a rolling termination when you extend the service life for a small amount of time for each request on the server side of the script) to correspond to the state of the user.
Edit:
The following article has a script to change the session cookie (scroll down until the cookie expires):
But, as Shoban correctly points out, there is a risk of Session Fixation (OWASP) . However, you can somehow protect yourself from this:
I would also add some caveats if your application stores confidential data (credit cards, financial, medical, etc.), then I would suggest not to do this and live with the fact that your user will have to log in again and start a new one session. Better than sorry.
source share