How to get the session durations.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pramod
Forum Newbie
Posts: 10
Joined: Mon Oct 25, 2004 6:28 am
Location: ind
Contact:

How to get the session durations.

Post by pramod »

Hi ,
I want to get the time (duration) of a browser session that exist on my site.

That is if user starts reading his mail box (session starts).Loged off (session ends ). difference of these to event is the duration of a user exixt on my site.

On php there is no event like session_onend().

If there is any other way please help me.

Thanks
Pramod.K.V.P
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Generally this is done by adding the session_id to a database, and on each reload compare the time of it entered to the current time.
Post Reply