Web Analytics Made Easy -
StatCounter Login session times - CodingForum

Announcement

Collapse
No announcement yet.

Login session times

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Login session times

    Does anyone know how to log the time of the existence of a session variable?

    Normally this is easy if there is a "logout" button... just detroy session then and note the difference in time.

    But what if a user navigates away from the page, or even closes the browser?

  • #2
    Re: Loggin session times

    But what if a user navigates away from the page, or even closes the browser?
    This is normally done by logging the "last actions" of the user and by checking the time which passed since his last action.
    Afaik there is no other way.

    You could create a javascript onunload event, open a popup with a php file destroying the session and closing it. The user won't notice this, but if he hasn't activated JavaScript or does have a popup blocker this won't work, of course.
    www.united-scripts.com
    www.codebattles.org

    Comment


    • #3
      If the user closes the browser, the session is destroyed. If the user goes to another site and within ~26 minutes clicks on back and goes to the site you created the session for, the session may still exist (depending oin how you validate the sessions).

      Comment

      Working...
      X