NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP "connection_aborted" and Capturing User Log Out/ Browser Close

Anirudh Zala nyphp at aumcomputers.com
Thu Jan 13 06:19:32 EST 2005


We use same option that mitch uses. I don't see any other way better than
this one.

Anirudh Zala (Z)

----- Original Message -----
From: "Mitch Pirtle" <mitch.pirtle at gmail.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Wednesday, January 12, 2005 6:57 AM
Subject: Re: [nycphp-talk] PHP "connection_aborted" and Capturing User Log
Out/ Browser Close


> On Tue, 11 Jan 2005 14:06:00 -0500, Peter Sawczynec <psaw at pswebcode.com>
wrote:
> > 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.
>
> Hey Peter,
>
> What I have done in the past was include a timestamp in the session
> (cookie that is, as well as in an 'online' table in the database), and
> after 5 minutes the authentication script updates the timestamp in the
> database.  I then have a cron job running every 5 minutes that deletes
> any records with timestamps > 5 minutes old.
>
> In essence, if you close the browser or leave without logging out,
> your 'session' will get tossed in 5 minutes.
>
> I'd love to hear of other approaches, to see what makes the most sense.
>
> -- Mitch
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>




More information about the talk mailing list