View Full Version : Counting time when logged in

04-22-2003, 06:14 PM
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 ?

04-22-2003, 08:23 PM
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.