Search Wiki:
A couple of years ago I was dealing with an ASP.NET application with session state issues. This happens, if you can believe it. I was flummoxed by the problem and the routine checks and configuration options didn’t seem to fix the problem (although there was one little thing that was causing me problems and I didn’t catch it before I went down the path I am about to write about). I decided I needed to find a way to peer into ASP.NET session state. Given that the web application was storing state in Microsoft SQL Server, the challenge was to figure out how to make sense of the state information stored in the database. For background information, check out this tag from my old blog.

If you have read some of those older posts, you might note that I wrote a session monitoring application a while back. That code is somewhere in the mists of time and I wouldn’t use it as it was anyway because it had some issues, so I decided to take another swag at it. Also, Philippe sent me an email asking for the tool, so I thought I would oblige and deliver it to everyone.

I had to read my own blog posts again and figure out how this works and it is a little rough, so consider this a starter project for somebody with more time who might improve it. The basic requirements are as follows:

*Create a class that monitors ASP.NET session data (if Microsoft SQL Server is backing session; otherwise, you are on your own!)
*Detect new sessions and provide basic information about the session
*Detect the removal of a session
*Detect new session items and provide basic information about the value (primitives and strings are directly supported)
*Detect session item value changes and maintain a history of the values as they change
*Detect session item removal
*Create a simple user interface to display session information
*Enable impersonation so session state stored in a database residing outside the current authenticating domain can be monitored
*Display sessions, session values, and session value history in a comprehensible manner
*Support direct inspection of session values of primitive types and strings
*Provide a property browser for non-primitive\string types (this is an area for improvement if somebody wants to build an extension that can unpack non-primitive types, but I warn you that because the session monitor does not necessarily run on the same machine where the web application is running, you might have a problem with type resolution!)

For more information, read this blog post: http://blogs.msdn.com/colbyafrica/archive/2009/01/18/asp-net-session-monitor-1-0-released-to-msdn-code-gallery.aspx

Colby
Last edited Jan 18 2009 at 8:11 AM  by colbyafrica, version 4
Updating...
Page view tracker