Counting active users

S

Sajid

Hi,

I'm developing an online shopping cart. Usually the site
administrator modifies products etc in the "Store". I want
a mechanism for the administrator such that he should be
able to view or at-least count the customers or visitors
in my "Store" (only in store), users of the other sections
should not be counted.

Whenever a user in my store signs out or closes the
browser (not properly sign out) or even leaves the "Store"
the count should decrement. Any solutions.

Note: For cart, I'm creating a session whenever a visitor
adds an item from the store. The session is destroyed when
visitor properly signs out.

Regards

Sajid
 
A

Aaron Bertrand [MVP]

Whenever a user in my store signs out or closes the
browser (not properly sign out) or even leaves the "Store"
the count should decrement. Any solutions.


Depending on how you're storing it, the count won't decrement immediately
because no event is raised when the user closes their browser or moves to
another site. You can wait for the session.timeout event (though
Session_OnEnd is not reliable; see ) or you can have a job that cleans up
sessions it believes are idle (which also needs to wait for session.timeout
to be accurate and not kill someone's session when they were just reading a
page for 10 minutes). See here for ideas: http://www.aspfaq.com/2491
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top