GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 24-Mar-2005, 21:23
jmumm jmumm is offline
Awaiting Email Confirmation
 
Join Date: Mar 2005
Location: Milwaukee, WI
Posts: 4
jmumm is on a distinguished road

Tracking logged in users


I have a table that keeps track of any people that are currently logged in to the system. When they manually log out it removes them from the "logged in" table in my database. I also wrote a timeout script. Everytime a new page loads it first checks to see if the current time is past the time that he scheduled to time out at (e.g. 20 minutes). If the current time is past the scheduled time out time, then it logs them out and deletes them from the table. If the user still has time remaining in his session, then it sets a new timeout time to 20 minutes from the current time.

This systems works but has one flaw, if the user closest out his browser hence not logging out first nor refreshing the page (to run the timeout script again), the user never gets deleted from the database. Is there a way I can get around this, like to see if his browser browser was closed?

Edit: sorry, I just realized I posted in wrong forum!
  #2  
Old 27-Mar-2005, 06:52
anjanesh anjanesh is offline
New Member
 
Join Date: Mar 2005
Location: Mumbai, India
Posts: 16
anjanesh is on a distinguished road
One of these three :

1. Use the Javascript event onload function in body to call the logout script. JS may not work all time if JS is disabled or popup-blockers disable unload event.
2. Next time the user logs in check if hes still having a prev session data in the db - if so remove it - atleast this will remove redundant entries from sessions table.
3. Cron Job - Write a script to check the last time timeout script was run by the user. Have this Cron Job set every 20-25 mins ?
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Adsense introduces tracking by URL Div Advertising & Affiliates Forum 1 14-Dec-2004 08:14
tracking city and country from IP address s786787 Web Design Forum 5 07-Nov-2003 00:23
Mvtracker.com - usefull tracking mvtracker Advertising & Affiliates Forum 1 31-Aug-2003 07:18
Script needed for letting user input a few days of data for tracking and analysis. tradertt MySQL / PHP Forum 3 06-Mar-2003 03:54
Slight increase in Netscape users? JdS Web Design Forum 10 01-Sep-2002 12:59

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 09:23.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.