> I used cron to do this as well; but i devised a much simpler, elegant
> solution that is cross-browser and event-based and not schedule-based.
> 
> I basically have a javascript include file that instantiates a function that
> counts down in T-minus 10 minutes fashion.  at 9:30 the browser pops a
> window and says "you appear to be inactive; would you like to continue
> working?"  clicking on yes closes the popup and resets the timer; not
> clicking expires the popout which redirects the parent page to the logout.
> clicking on "log me out" basically circumvents the 30-second countdown
> straight to the logout.
> 
> to handle the alt+F4-happy crowd i devised a way to pop a special logout
> window when the browser is closed. this child window destroys sessions and
> makes database logs; this window closes itself.
> 
> this happened to work for me, YMMV.
> 
> ~phillip jackson

I've recently faced a similar issue. I lock CMS database records during
editing so multiple users can't edit simultaneously. It's easy to unlock the
records via PHP if the user goes to any other area of the CMS or if she logs
out. The problem is that users often don't log out, and sometimes leave
directly from an edit screen. I tried using the Javascript onunload event to
open a new window which runs a PHP script to unlock the record then close
itself, but that doesn't work if pop-up blocking software is being used.
Does your method do something similar? Does it work with pop-up blocking?

--
Lowell Allen

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to