Saturday, December 27, 2008

ASP.net Pitfall

Recently we faced a strange issue in one of the production servers. The session information was shared between 2 users in the ASP.net application. We then thought to print the Session ID in the browser and was perplexed to watch that 2 different sessions printing the same session id. I then googled out to see the possibility of
a session id getting duplicated but it was never possible. Then I got a vital information in the URL below

ASP.NET page is stored in the HTTP.sys

The culprit was output caching. When enabled the cache in the ASP.net kernel stores the page along with the set cookie response in the HTTP header. This causes the same page to be redirected to different users. A weird issue is'nt it. You can get the solution in the aforesaid URL.