Exforsys

Free Training

displaying number of members and visitors online

This is a discussion on displaying number of members and visitors online within the ASP forums, part of the Programming Talk category; Hi, I want to display the number of members and visitors currently online in ASP. I tried doing this using ...

Go Back   Exforsys > Programming Talk > ASP

Exforsys.com

  #1 (permalink)  
Old 09-16-2004, 04:41 AM
Member
 
Join Date: May 2004
Posts: 42
itzsug
displaying number of members and visitors online

Hi,

I want to display the number of members and visitors currently online in ASP. I tried doing this using application and session variables. But the problem i faced was when a user closes the window without logout/signout, the session variables still exist until the specified timeout, as a result the number of members doesnot change.

How can achieve this?

Thanks.

from
Jagadish
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-16-2004, 05:06 AM
Senior Member
 
Join Date: Nov 2004
Posts: 132
Vasu
Re:displaying number of members and visitors online

Hi,

When you close the browser window, call the method in which it clears the user from the session.

When you logout, i guess u r calling one method, for eg logout() where u r removing user from session.

So when you close the window, call logout() method.

sample code:

in ur page, javascript code looks like this:
window.onunload=onClose
function onClose(){
//when u click x on the topcorner, it will go inside the foll. if loop.
if(window.screenTop>10000)
{
//call logout() method
}
}

I dont know ASP, i told in general...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-16-2004, 05:10 AM
Member
 
Join Date: May 2004
Posts: 42
itzsug
Re:displaying number of members and visitors online

Hi Vasu,

Thanks a lot for the information. Do I have to write a javascript function and call that on every page on window close event.

Thanks.

from
Jagadish
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-16-2004, 05:26 AM
Senior Member
 
Join Date: Nov 2004
Posts: 132
Vasu
Re:displaying number of members and visitors online

Yah,
we need to write javascript function on each page.
As we need to handle the event on closing the browser without logging out from application, i guess we need to go for java script.

There may be some other good solutions.

The one that i told is easy to implement.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:48 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.