Counting active users when using sessionState mode=StateServer ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bjorn Sagbakken

    Counting active users when using sessionState mode=StateServer ?

    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)Applicati on["UserCount"]+1;

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

    However, with sessionState mode=StateServe r, 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_Pr eRequestHandler Execute) 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


Working...