大网数据广告活动
Web 标准与前端开发

Set-Login header

· 52CE 我爱测

The HTTP **`Set-Login`** response header is sent by a federated identity provider (IdP) to set its login status, and indicates whether any users are logged into the IdP on the current browser or not. This is stored by the browser and used by the FedCM API to reduce the number of

The HTTP Set-Login response header is sent by a federated identity provider (IdP) to set its login status, and indicates whether any users are logged into the IdP on the current browser or not. This is stored by the browser and used by the FedCM API to reduce the number of requests it makes to the IdP as the browser doesn't need to request accounts when there are no users logged in to the IdP. It also mitigates potential timing attacks.

The header may be set on any response resulting from a top-level navigation or a same-origin subresource request on the IdP's origin site. Any interaction with the IdP site may result in this header being set, and the login status being stored by the browser.

See Update login status using the Login Status API for more information about FedCM login status.

<table class="properties"> <tbody> <tr> <th scope="row">Header type</th> <td>Response header</td> </tr> </tbody> </table>

Syntax

Set-Login: <status>

Directives

  • <status>
    • : A string representing the login status to set for the IdP. Possible values are:

      • logged-in: The IdP has at least one user account signed in.
      • logged-out: All IdP user accounts are currently signed out.

      [!NOTE] Browsers ignore this header if it contains any other value.

Examples

Set-Login: logged-in

Set-Login: logged-out

Specifications

Browser compatibility

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。