When Session Objects Get Created With No Session Variables

land-075

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 …


Other Related Items:

Programming ASP.NET (O'Reilly Windows)Programming ASP.NET (O'Reilly Windows)Suitable for most any programmer who wants to master ASP.NET with an eye toward real-world development, Programming ASP.NET is an excellent resource t... Read More >
The Obama DiariesThe Obama Diaries(WASHINGTON, D.C.) On May 20, 2010, Laura Ingraham received a package from an anonymous source that will change the history of the United States and t... Read More >
Port Authority 44 (Secure In Band/Out of Band Management Terminal Server)Port Authority 44 (Secure In Band/Out of Band Management Terminal Server)Encrypted console port access to 4 host ports and 4 power reset ports over the network or dial-up regardless of the status of the network. This is a ... Read More >

Related Post

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

DotNetNuke Sponsor

 

Most Valuable Blogger
Sponsor