Ramblings of the constant presence of Gates in my life RSS 2.0
 Saturday, May 31, 2008

I have been writing web applications for several years now. Whether you like sessions or not, I have made REALLY good use of them in classic ASP, .NET 1.1, 2.0 and now 3.5. Oddly enough, I never had an issue where my session was lost unexpectedly in one of my applicaitons until now.

It seems (according to lots of posts out there - and MSDN) that sessions are treated a little differently in .NET. Hmm, really, no kidding! But, the changes made to session management shouldn't cause my user to hit the page and immediately lose their session, right? If so, I am really in trouble, becuase like I said, I likes the sessions.

After reading about a thousand posts that didn't fix my problems and trying every combination of session state management (SQL, StateServer, InProc, BiteMyProc) nothing was working. I actually gave up on it at about 9:30 at night after working on it for 3 hours.

I came back to it yesterday after a not so great night of sleep, but still with a fresh mind. Suddenly it popped into my head that MAYBE the browser/IIS were being somewhat intelligent for me (thanks). MAYBE, since I was only wanting to track the SessionID and didn't store anything into that session as a variable, the system ASSUMED I didn't need that session to stick around. Yep, I put a line of code in my landing page that looked like this: session("hold") = "I cannot believe it was this stupid" and ran my site. There it is, sessionID is persisted.

I wouldn't really care too much about that except that I have done similar things in classic ASP and the session was always maintained even without information stored in it. It would have been nice, and I am pretty sure I have said it before, for Microsoft to document this one a little better (or maybe at all).

Saturday, May 31, 2008 8:04:08 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Posted By: Mark Wall
Blog Categories: .NET Dev
All comments require the approval of the site owner before being displayed.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview
Advertisements
Archive
<May 2012>
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

Blogroll
Statistics
Total Posts: 27
This Year: 0
This Month: 0
This Week: 0
Comments: 6
Themes
Pick a theme:
All Content © 2012, Mark Wall