Results 1 to 8 of 8

Thread: message board

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    UK
    Posts
    164
    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

  2. #2
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    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!]

  3. #3
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    Hi alexmac,

    You can use the Session_OnEnd() event in the global.asa file.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    UK
    Posts
    164
    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.

  5. #5
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554
    Or whenthe visitor leaves your domain then you would SESSION.ABANDON

    DocZaf
    {;->

  6. #6
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    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!]

  7. #7
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554
    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
    {;->

  8. #8
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    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
  •  



Click Here to Expand Forum to Full Width