I have written a VBA plugin for Excel, which provides login/logout functionality to a server.
The way I have implemented it is to send a request to a URL on the server, which checks if the user has a session, if it does not, the server sends a 401 on the header response (unauthorised). The 401 response makes Excel automatically pop up the 'windows style' login modal (this comes for free with Excel I guess). I enter my credentials, and the server authenticates the user, and a session is created.
My problem is now when I try to logout. The server destroys the session as expected. If the user now clicks login again, Excel sends a HEAD request to the server, the server responds with a 401, and Excel then automatically sends the same username and password credentials that were entered by the user before. The user is now logged on again. Just to be clear - this is NOT server side caching, this is Excel resending login credentials, using Basic Authentication in the HTTP Header, after receiving a 401 response.
This is not the expected behaviour, I would not like Excel to store a copy of the credentials, and reuse them time after time. If the user logs out, I would like this to be permanent, until they decide to log in again at which time they should re-enter their credentials.
The problem I have is telling Excel/Windows/VBA? to clear whatever it is keeping, wherever it is keeping it. My problem is, I don't really know what the choreography is on the Excel/VBA side, it's functionality that just seemed to come for free, so I do not know where this is stored.
For what it's worth, here is my VBA
Dim req As MSXML2.XMLHTTP60
Set req = New MSXML2.XMLHTTP60
req.Open "GET", url, False
req.send