Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2003
    Thanked 0 Times in 0 Posts

    Counting time when logged in

    Can u tell me how do we know how long the user have been logged in with PHP session ? I used the session start iun the login page and all other pages that having user authoration .
    I registered the username , not the timer , will it return the wrong way to count the time the user has been logged on ?

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Marion, IA USA
    Thanked 83 Times in 82 Posts
    Well what you could do is.....when they log in grab a timestamp and store it in the session and then at any point you wish to display how long they have been logged in take another timestamp and compare it with the one that you stored previously and compute the amount of time and display it.
    CodingForums Supreme Overlord
    All Hail Spookster


    Posting Permissions

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