Login Logout status maintenance

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samatair
    New Member
    • Nov 2007
    • 61

    Login Logout status maintenance

    I am using sessions to maintain login/logout status. I update the table when a user logs in and logs out. But some users don't logout. How to automatically log them out and update the status.
    I had used the meta tag to refresh the page after 20 mins, so if the page is kept opened it automatically logs out the user after 20 mins. But it's not providing me results which I expect. Please anyone let me know, how to do this?

    Thanks for your help!
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    You will have to store the time and date of the last login, and then compare it to the current time and date, and if it's over saying 30mins, assume the user has logged out. There's no exact way of knowing, unfortunately.

    Comment

    • samatair
      New Member
      • Nov 2007
      • 61

      #3
      Yes, I have stored the Last Login date and time. So should I use a Cron or a Schedule Job to run a code with every 30 mins to check and update the user status?

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        No, I don't think that's necessary.

        You must have a page that checks if the user is logged on, maybe the user profile, to show if he/she is logged on?

        You could do the update on that page.

        Comment

        • samatair
          New Member
          • Nov 2007
          • 61

          #5
          I think your solution might work. But I have to check it. Thank you very much Markus

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by samatair
            I think your solution might work. But I have to check it. Thank you very much Markus
            You're very welcome.

            Comment

            Working...