[nycphp-talk] PHP

John Nunez john at
Sun Jan 23 23:10:50 EST 2005

Hey Guys,

Maybe I am missing the question here but wouldn't the simplest solution 
be "session-set-save-handler".

Use this function and insert it as a include into each of your pages 
before the session is started.  This will allow you to manage your 
sessions.  Therefore you can create the functions that will open and 
close a session.  On close you can easily write the time to the db.

See :

John Nunez
Cyber-NY Interactive
john at

On Jan 11, 2005, at 2:16 PM, Rahmin Pavlovic wrote:

> On Tue, 11 Jan 2005 14:06 , Peter Sawczynec <psaw at> sent:
>> Using PHP, is there a simple way to capture browser shutdown or a 
>> session
>> termination event, so that a user's departure time from a site can be
>> captured when they don't use the formal Log Out button.
>> I need to track user time logged into a site. I am using PHP sessions.
>> Currently, capturing the user Log In efforts and capturing the user 
>> Log Out
>> time when they hit Logout button.
>> Any solution suggestions for capturing log out time of users who just 
>> close
>> the browser?
> A possible solution would be log 'on-site' time by saving a timestamp 
> of every
> page view.  We do that in-part to prevent additional log-in's from the 
> same
> account during a given active timeframe.
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)

More information about the talk mailing list