views:

302

answers:

2
+3  Q: 

IIS Session State

Here's a story problem:

I have website set up in IIS 6.0 (Win 2003) and has checked the "allow session state" setting the configuration in IIS.

If a user navigates directly to a static html page on my site, (not an asp or aspx page), does IIS start a session for the user or not?

+2  A: 

No, IIS will not start a session.

HTML pages are not handled by the ASP.Net pipeline, so they wouldn't be considered part of your web application. Session_Start() in your Global.asax file does not fire if you hit an HTML page.

You can verify this by putting a breakpoint in your global.asax file in the "Session_Start" function, and setting your startup page to be a simple HTML file.

womp
A: 

Also note, if the user hits an ASPX page, IIS will not start an ASP session, only an ASP.Net session. The session state is created by the ASP and ASP.Net ISAPI Filters, and the two are pretty much independent.

Christopher_G_Lewis