【问题标题】:PHP auth not perfectlyworking in chromePHP auth 在 chrome 中不能完美运行
【发布时间】:2016-05-06 11:40:00
【问题描述】:

PHP认证码是:

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    header('WWW-Authenticate: Basic realm="My Realm"');
    header('HTTP/1.0 401 Unauthorized');
    echo 'Text to send if user hits Cancel button';
    exit;
} else {
    echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
    echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>";
}

问题是消息 Basic realm="My Realm" 未在 Chrome 中显示,但它在 Mozilla Firefox 中符合我们的预期。

【问题讨论】:

    标签: php google-chrome authentication


    【解决方案1】:

    最近在 Chromium 问题跟踪器上报告了一个关于该问题的 issue,该问题已与 this 合并。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-18
      • 2016-08-18
      • 1970-01-01
      • 2013-04-20
      相关资源
      最近更新 更多