I thought Session State was available in PreRequestHandlerExecute...

Published 27 September 03 06:41 PM | alexcampbell

...but that appears to be wrong.  Or am I going insane?

I've been receiving a couple of emails every week for the last 2 years asking “How do I make an application that shows which users are visiting my website right now, and what pages they have visited during their session?”  Rather than removing my email address from my website or setting up an autoreply to these messages explaining how much this would slow down their web server, I have written an article at ASPAlliance explaining how to do it.

Adding a row to the database table when a session starts is no problem (except for the obvious performance issues), but adding a row to the VisitedURLs table when Application_PreRequestHandlerExecute is raised seems impossible because (despite MS documentary claims to the contrary) Session State is not available in that event.  Source code available here if you want to have a look.

Astute readers will notice the new article management system at ASPAlliance.  Still a few bugs in the process but Steve Smith has done a great job!  The old server has been shitting itself for over12 months and our host Orcsweb has done a great job keeping it from dying.  We are now moving the main site to a cluster and the author's sites to http://authors.aspalliance.com.

Comments

# Logan said on October 9, 2003 11:26 AM:

I thought Session State was available in PreRequestHandlerExecute...
...but that appears to be wrong. Or am I going insane?


It would appear that you are correct - I am going insane too...