I have been looking all day for a PHP or JavaScript solution to do this.
I would like to alert the user their session is about to time out (popup), ability to extend
You can sidestep the issue by having a script which returns a 1x1 pixel image on a JS timer. The idea is that you start with a PHP script like this (not sure if the header calls in here are exactly right..):
header("ContentType: image/gif");
passthru("my-1x1.gif");
Now, have the javascript setInterval function call this script at a suitable interval (i.e. less than the session GC interval). Because the image is served from PHP it updates your session, so theoretically your user's sessions wont end as long as they remain on your site.