NYCPHP Meetup

[nycphp-talk] PHP

charlie derr cderr at simons-rock.edu
Tue Jan 11 14:59:19 EST 2005


What about using <meta http-equiv="Refresh" content="60; http://yoururl">
in the header of the page?

As i understand it, this would try to grab a new copy of the page every
minute (modify the 60 if you want a longer or shorter time).  By keeping
track of when the reloads cease, you'd know when the visitor closed the
browser (or lost network connectivity) even if she/he didn't hit the logout
button.

And surely it'll be no picnic to integrate something like this with your
already existing authentication code (so that it works seamlessly and doesn't
demand a new login on every automatic refresh once a minute).  And if your
pages are places where people can input data (via forms), it'd be a real
drag to have the page automatically reload (and lose the paragraph or so of
text that your visitor just entered in a form field(s)).


	good luck,	
		~c

Peter Sawczynec wrote:
> This is a possible "almost does it" option. 
> 
> The time of every new page hit by the user can be entered as the newest
> logout time. So if they never formally logout we at least have an
> approximate Log Out time. If they really Log Out, we get the Log Out time
> for real.
> 
> By the by, there is a way to rig something with JavaScript and the onUnload
> event. But it has pitfalls too.
> 
> I am surprised now that PHP doesn't offer "on session start" and "on session
> end" event capturing, or am I wrong?
> 
> Thanks, 
> 
> Peter
> 
> -----Original Message-----
> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
> Behalf Of Rahmin Pavlovic
> Sent: Tuesday, January 11, 2005 2:17 PM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] PHP
> 
> 
> 
> 
> On Tue, 11 Jan 2005 14:06 , Peter Sawczynec <psaw at pswebcode.com> 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)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
> 
> 
> _______________________________________________
> 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