When Session Objects Get Created With No Session Variables


I thought about calling this  Session Object Madness, but it really isn’t that crazy once you think through what’s happening.

Here’s the issue.  I have a client who does work for another client who is hosting their sites at IBM.

I’m told that IBM will not enable any session servers so none of the sites can include session objects.  And that’s where the fun begins.

Now I won’t go on with my normal rant about how this is just insane and how it is costing the client more for us to write code around this than if they moved the operation someplace else.  But here’s the issue.  We wanted to  add a Global.asax file to the site so that we could process errors and redirect to an error  page.  When we put this on our staging server that is half set up for a SQL session server, we started getting errors because the site was trying to connect to the session server but didn’t have a database to connect to.

What was curious was that we weren’t creating any session objects in any of the code, so the call to the database should never have happened.  Then I remembered, the Global.asax file has event handlers for SessionStart and SessionEnd.

Once we took the two event handlers out, the code started working again.

Note to self: session objects also get created when they need to attach to an event handler.

Other places talking about ASP.NET Session Objects

Coupling ASP.NET Session State With Forms Authentication – Paulo … – The session ID manager will return this session ID when queried by the session state HTTP module: public class SessionIdManager : global::System.Web.SessionState.ISessionIDManager { #region ISessionIDManager Members public string …

Difference between ASP.NET Sessions, Application variables and … – When developers start with ASP.NET Web Forms the question I always get is; where is the best place to store user information, the application variable, the session state, cookies, database or the cache objects? …

Session Time Out Tricks : Misfit Geek – I WANT TO IMPLEMENT SENDING SMS THROUGH ASP.NET. ASHOKTANU — March 1, 2010 4:23 PM. Jone avatar. >> we could implement an AJAX service method and query the server as to whether or not the REAL .NET session has expired …

BCA: ASP.NET 2.0 Session State Partitioning – SqlSessionStateStore supports a key scalability feature of ASP.NET 2.0 known as session state partitioning. By default, all sessions for all applications are stored in a single SQL Server database. However, developers can implement …

Related Post

3 Responses to “When Session Objects Get Created With No Session Variables”

Leave a Reply

Comment Policy:

  • You must verify your comment by responding to the automated email that is sent to your email address. Unverified comments will never show.Leave a good comment that adds to the conversation and I'll leave your link in.
  • Leave me pure spam and I'll delete it.
  • Leave a general comment and I'll remove the link but keep the comment.

Notify me of followup comments via e-mail