Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm, apache force chunked, nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot

Links

XODOX
Impressum

#1: Counting active users when using sessionState mode=StateServer ?

Posted on 2008-04-24 22:34:58 by Bjorn Sagbakken

The subject says it all, more or less.
With sessionState mode=InProc in web.config this works fine, using this
approach in the global.asax:

In the session_start event the count up:
Application["UserCount"]=(int)Application["UserCount"]+1;

In the session_end event the count down:
Application["UserCount"]=(int)Application["UserCount"]-1;

However, with sessionState mode=StateServer, the session_end does not fire,
so a workaround has to be appended.
I just haven't found the best approach yet. I have tried one suggestion,
where another event was added to the global.asax
(Application_PreRequestHandlerExecute) where the reading of the current
userID stored in a session var was a part of the idea. However, I got an
error message, saying the "session is not available...." or something like
that. Then I tried to implement a needed Http module in the web.config for
this, but obviously I got rather lost with other error messages about wrong
assembly.

So, before I stumble more in half blindness, I would be happy for any
pointing directive.

Thanks.

Bjorn

Report this message