Client close Event

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
User avatar
New php-forum User
New php-forum User
Posts: 86
Joined: Mon Jun 04, 2012 10:05 pm
Location: Ankara, Turkey

Tue Jun 12, 2012 3:30 am

Determining when a user connects to a website for the first time should be pretty easy with the proper use of Sessions.
The tricky part would be determining when the client leaves the website. The best you could do would be to monitor the user's activity on the website, and then execute a script when the user has been inactive for several minutes. I imagine such a solution would use cron tasks to identify users which are recently inactive, and then execute a PHP script.

I hope that helps. Good luck!

Post Reply