How to log out user from web site using BASIC authentication?

后端 未结 22 1915
感情败类
感情败类 2020-11-22 04:00

Is it possible to log out user from a web site if he is using basic authentication?

Killing session is not enough, since, once user is authenticated, each request co

22条回答
  •  梦谈多话
    2020-11-22 04:45

    This isn't directly possible with Basic-Authentication.

    There's no mechanism in the HTTP specification for the server to tell the browser to stop sending the credentials that the user already presented.

    There are "hacks" (see other answers) typically involving using XMLHttpRequest to send an HTTP request with incorrect credentials to overwrite the ones originally supplied.

提交回复
热议问题