|
-
Feb 15th, 2001, 10:20 AM
#1
Thread Starter
Addicted Member
Hi I am writing a messageboard/forum application and want to include a list of users loged in. What I was wondering was what is the best way to get rid of users that have just gone to another page or disconnected rather than logged out properly.
The users details are stored in an Access Database which contains a field called status (1 for loged in 2 for not).
I guess I could check to see when they last made a request and then have a timeout value of say 20 minutes or so but is there a better way?
Any thoughts appreciated
Alex
-
Feb 16th, 2001, 03:23 PM
#2
Fanatic Member
the only way i would know how to do it is to log the last time a page was requested and ever so often query the db.
there is java commands to do things when a person leaves your page. maybe open up a small web page that tells your cgi that the person is leaving and then closes itself automatically
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Feb 17th, 2001, 05:17 AM
#3
Addicted Member
Hi alexmac,
You can use the Session_OnEnd() event in the global.asa file.
-
Feb 17th, 2001, 06:32 AM
#4
Thread Starter
Addicted Member
Thanks for the replys guys! You have given me some things to think about. I think the global.asa idea would work well.
Alex
ASP, SQL, VB6, Java Script and dubious guitar playing skills.
-
Feb 18th, 2001, 11:48 PM
#5
Fanatic Member
Or whenthe visitor leaves your domain then you would SESSION.ABANDON
DocZaf
{;->
-
Feb 19th, 2001, 07:41 PM
#6
Fanatic Member
I didn't know browsers tell the server it last left that it was going somewhere else??
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Feb 19th, 2001, 10:40 PM
#7
Fanatic Member
I don't think they do as such
but its something you trap for like :
mouse down event occurs
and if the window.events.srcelement is of type <a> then if the domain is not the same domain as yours then session.abandon
if that makes sense.
DocZaf
{;->
-
Feb 20th, 2001, 10:44 AM
#8
Black Cat
Sessions end if the user doesn't request another web page from your server with X minutes of requesting a prior page, with X being either 20 or 30, I can't remember exactly but I'm pretty sure IIS will let you change it anyway ( or turn Sessions off entirely ). They also end with Session.Abandon. You'd use it on a log-out script or before a Response.Redirect to free the chunk of server memory early if you know the user is done or is not coming back.
All a session is is a random-gibberishy Cookie that the server tracks for so long, so it knows whether or not the client has requested earlier pages.
Josh
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|