Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2007
    Location
    UK
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Logging out trouble?

    Hi, when i login the username appears on the online users box, when you logout it goes. However if you close the internet browser instead of logging out the username stays and you username will show more than once if you close the internet browser again and again until you press logout. I know why the problem is, it is because when you logout it deletes the username, how can i avoid that problem, any ideas???
    http://www.smgames.staticfire.co.uk Under construction, Currently hiring mods and admins anyone interested pm me.

  • #2
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts
    You need two things:

    1) When you login, you delete any existing login sessions for your name.
    2) You create a script that executes on every page that checks for "idle" users. Any user over a specified time (10 minutes for example) is then automatically logged out.

    For #2, when someone logs in, you log the date/time in their own "last activity" field. Every page the user accesses, their date/time activity is updated to the current time. Before updating the date/time activity field for the user, however, you check ALL USERS' date/time activity fields to see if their last activity is more than 10 minutes behind the current date/time. If it's been more than 10 minutes from the current time, you log them out.

    -Shane

  • #3
    New Coder
    Join Date
    Jul 2007
    Location
    UK
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    do you know anywhere that i can get a script like that
    http://www.smgames.staticfire.co.uk Under construction, Currently hiring mods and admins anyone interested pm me.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •