That should work fine, but you can also check the REQ constant (docs) which has the following possible values:
CP - Control panel requests
PAGE - Frontend template requests
ACTION - Module actions, e.g. mysite.com/?ACT=123
if (REQ == 'CP')
Wanted to share this here because I figured it would help others debug in the future.
The problem is with the Zoo Visitor extension- it's the session_start() function right at the beginning of the file. The server chokes on it- it also chokes on the example from the PHP docs in a completely standalone form. So my suggestion was to take it to the server ...
The elegant part: Around 20 or 30 secs before expiration, popup a dialog that the session is about to expire.
(maybe redirect to a page where the user is going to be logged out, to prevent redirecting without the session ...
Although the hook doesn't provide any information you can use, you could do a query on the exp_members table where ip_address is equal to the users ip, and sort the results by last_activity descending. Logging out should record the timestamp into the last_activity field and the ip address is updated every time a member logs in. As a result, this should then ...