Re: executing a script on browser exit?
| From: | Kevin Beckford | Date: | Thu, 31 Aug 2000 20:48:48 +0000 |
| Subject: | Re: executing a script on browser exit? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-14684@lists.php.net to get a copy of this message | ||
None taken :)
Using a database:
Right now you are using the client to save your session data. You as a
programmer have no control over the client side. If you store your session data
in a session table, then you have total control over it. You put code on your
pages to write to the db when a page is left, perhaps incrementing a value
there, among other things. Using persistent connections will reduce the drain
on system resources, a drain which is negligble when compared to writing and
searching text files. Include a timestamp value in the database, and for any
timestamps over some interval, you can write the page counter to a separate,
more permanent table, and delete that session record in the session table.