Q. Basic Authentication: how can I log a user out?
The browser caches the username and password until the browser is closed.
The Basic Authentication protocol does not allow you to "logout" a user without changing his password.
The Basic Authentication protocol does not support the notion of timeout either.
You could use AuthentiX cookie-based authentication which supports timeouts and logouts.