Session count always increasing

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
 
M

Munawar Hussain

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
 
X

xisco

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top