Matt Monaco wrote:
If you store your "login object" in a session, when the browser window is
closed the object will automatically be destroyed, thus calling the
destructor.
exactly what is it that triggers the object destruction??? since when is it
normal practice for a browser to do a request to tell a webserver that it is closing
[itself]???
you cannot do this at all with just php, HTTP is stateless!
it might be possible to use some browser plugin to hit the server
if it notices that it's window is being closed... although I have a sneaking
suspicion that Flash, for instance, has the same problem as javascript with
not being able to differentiate between the page unloading and the window closing.
**as far as I know there is NO WAY to tell when the user closes the window, unless
you give them a specific way of telling you (e.g. via a 'log off and close the window'
link) and they are nice enough to only use the mechanism you provide (fat chance :-).
the normal way of doing session 'closing' is by way of 'garbage collection' -
every now and then a script/process/function is run that 'closes' any sessions
which are (according to your criteria) inactive. php has stuff built it that will
do this for you to a degree.
In response to the message you send directly to me, you would create a file
called Login.class.php and at the top of each page include the file using
require_once("Login.class.php");
Matt
""mail.pmpa"" <mail.pmpa@xxxxxxx> wrote in message
news:000601c5f480$32976120$6f2e9a52@xxxxxxxxxx
De: Matt Monaco [mailto:mmonaco3@xxxxxxx]
Create an object with the functionality of your choosing, in the destructor
perform your cleanup operations.
The problem is I don't know when a member closes the browser window.
If I knew that i would automatically logout that member.
Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php