A reliable method of logging people off via http authentication. It has been tested on ns3,4 and ie4,5. It's just a skeleton, you'll need to fill in the database requests yourself.
<?php
// this is the logoff script which will simply set the
// loggedon variable of the user to 0.
// This will cause the next password check of the user
// to fail.
// the previous script will then send the Deny message, with
// a $realm which contains a timestamp. This means that the
// browser will get a realm which it doesn't know. Therefor, it
// will not have any default user login/password to go with it.
// this prevents IE4,5 from trying it once again, without user
// intervention or displaying the login/password in the login
// window.
//
// The authentication routine for this script is the same