This project has moved. For the latest updates, please go here.

Storing the Session State outside the memory of the web server

As illustrated in Fig1. a classic web site architecture is composed of  a load balancer that sends traffic to web servers and a SQL Server database. In classic ASP the Session State is stored in the memory of each web server and is not shareable with an ASP.NET web site. So the Homelidays Session State allows the storage of the ASP session into a Microsoft SQL Server database and to share it with an ASP.NET web application. To achieve this goal, the Homelidays Session Service serializes the ASP session state as XML before storing it into the database. XML allows sharing session state between technologies: Classic ASP and ASP.NET. Homelidays Session Service sends a cookie, the session cookie, which contains a session identifier to the browser which is used to find the current session state in the database.

image

Fig1. Session Service global overview

As illustrated in Fig2. the database model is very simple. The primary key is the session id sent to the browser. The serialized session state is stored in the Data field. The LastAccessed and the SessionTimeOut fileds are used to determine if a session has expired. A job running on the Microsoft SQL Server clears the expired sessions. The database is created dynamically by the session service. You can store the data in the database of your choice. An optimal choice would be tempdb as it is a memory database.

image

Fig2. Session Service data model

Homelidays Session Service and pages life cycle

For classic ASP, the Homelidays Session Service mechanism is related to the page life cycle as describe in the following chart:

image

Fig3. Classic ASP Page life cycle and Homelidays Session Service

If no call to the Session is made during the page life cycle, no call to the database is made.

For ASP.NET the mechanism is very similar except the COM component instantiation. COM is only used for classic ASP, Homelidays Session Service is implemented as a full .NET library for ASP.NET.

Homelidays Session Service requirement

Session Service works on 32 bits and 64 bits editions of:

  1. Windows XP;
  2. Windows 7;
  3. Windows Server 2003;
  4. Windows Server 2008;
  5. Windows Server 2008 R2.

The Homelidays Session Service Setup will install:

  1. .NET framework 3.5 sp1 (if needed);
  2. Microsoft Visual C++2008 Redistributable runtime (if needed);
  3. A COM component used for Classic ASP pages that replaces the session state mechanism provided by IIS;
  4. A .NET assembly into the Global Assembly Cache (GAC).

Install the Homelidays Session Service

Last edited Dec 18, 2010 at 11:08 PM by Yanal, version 12

Comments

No comments yet.