Session count always increasing

  • Thread starter Thread starter xisco
  • Start date Start date
X

xisco

hi all,

I am counting the number of users logged in my website. That's how I do in
my global.asax (asp.net 2.0)
- in my application_start I initialize an application variable with 0;
- in session_start I add my application variable + 1
- in session_end I decrease application variable -1
my session timeout is 60.
Then I display in the welcome page the total of visitors. So is ok, I open
some browsers in my computer and I see the number of connected users
matching.
But it does not matter how many people get connected, the number never
decreases. Even when I close my windows, the number is still there.
is that a normal behaviour? how to kill a session when it is not in use
anymore?

thanks in advance
xisco
 
hi
You need to lock the application while doing increment or decrement in the
counter.

2nd thing, you should call the session.abdon in when user click signout..

Best of luck...

Munawar
 
yes, was the abandon missing.
thx
xisco


Munawar Hussain said:
hi
You need to lock the application while doing increment or decrement in the
counter.

2nd thing, you should call the session.abdon in when user click signout..

Best of luck...

Munawar
 
Back
Top