Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is in-process the only way classic ASP can store session state?

I know it's a simple question, but I can't seem to drag it out of Google noise. I know .NET can use a session state service or a SQL database to back its session state, but I don't know if ASP offers any out-of-process options for storing it. Does it have any, or am I stuck with losing session variables on ASP applications when a load-balanced server is taken offline?

like image 606
Chris Avatar asked Jul 10 '09 17:07

Chris


People also ask

What is the mode of storing ASP.NET session?

Modes of storing session dataIn - Process: Stored in the same ASP.Net Process. State Server: Stored in the some other system. SQL Server: Stored in the SQLServer database. Custom: this enables you to store session data using a custom storage provider.

Can you share the state between classic ASP pages and ASP.NET pages?

Yes but they will not share the session memory.

How does SQL Server session state works?

The session state is stored in the ASPState database. The advantage of this method is that the data is persisted even if you restart the SQL server. Custom storage: Both the session state data and the stored procedures are stored in a custom database. The database name must be specified in the configuration file.


1 Answers

Yes, only in memory

From MSDN Full Article

ASP Implementation

The native ASP session can only store session data in memory. In order to store the session data to SQL Server, a custom Microsoft® Visual Basic® 6.0 COM object is written to manage the session state instead of using the native session object. This COM object will be instantiated in the beginning of each Web request and reload the session data from SQL Server. When the ASP script is finished, this object will be terminated and the session state will be persisted back to SQL Server.

The primary purpose of the Visual Basic 6 COM Session object is to provide access to the Microsoft® Internet Information Server intrinsic objects. The Visual Basic 6.0 COM Session object uses the mySession class of SessionUtility assembly to hold the session state, and the SessionPersistence class of SessionUtility to load and save session data with SQL Server. The mySession and SessionPersistence classes are exposed as COM objects using the regasm.exe utility. The regasm.exe utility can register and create a type library for the COM client to consume Framework classes.

The session state information is reloaded during the construction of the object. The constructor (class_initialize) will first retrieve the session cookie, session timeout (SessionTimeOut), and database connection string (SessionDSN) from the Application object, and create an instance of the class mySession to hold the session data. Then the constructor will try to reload the session data from SQL Server with the given cookie. If the SQL Server does not have the session information, or the session has been expired, a new cookie will be issued. If the SQL Sever does return with the session state data, the session state will be stored in the mySession object.

like image 153
Cody C Avatar answered Nov 23 '22 17:11

Cody C