I use XMLHttpRequest and basic-auth to access application interface. Password is temorary and is generated by other request, so it expires after some time.
But browser (Firefox least) keep using old one, failing and showing login popup. If i suppress popup by returning 403 for requests with X-Requested-By and wrong password, mozilla never tries to use new password (firebug shows new password in request, server receives old).
Problem can be evaded by adding random 'salt' to username (and stripping it at server side), but is there better way to force XMLHttpRequest use provided password instead of cached?