「ログアウト」を踏んだときに

HTTP/1.0 401 Unauthorized
WWW-Authenticate: Basic realm="hello"

というレスポンスをサーバーが返せば、
大抵のブラウザはログアウト状態になるよ。