【发布时间】:2013-12-30 23:27:45
【问题描述】:
我在我的站点中启用了基本身份验证。我可以在 IE、Mozilla 和 Chrome 中清除用户凭据,但无法从 Safari 中清除凭据。
我尝试了以下
调用Ajax请求并将状态码设置为
401使用 URL 中传递的用户名调用 Ajax 请求:http://invalidUSer@site.com
但是它们都不能正常工作。每当我关闭并打开一个新的 Safari 凭据时,都不会被删除。
下面是sn-p的代码:
在注销页面我有以下脚本:
$.ajax({
type: "POST",
contentType: "application/javascript",
async: true,
url: "../ClearAuthentication.aspx"
});
在 ClearAuthentication.aspx.vb 中
'Context.Response.Redirect("http://www.test.com", False) ' have tried this both adding and removing
Response.StatusCode = 401
Page.Response.StatusDescription = "Unauthorized"
'Page.Response.AppendHeader("WWW-Authenticate", "Basic realm=""foo""") ' have tried this both adding and removing
Context.Response.End()
【问题讨论】:
标签: safari basic-authentication logout