Skip to content
Niu DocsNiu 牛元文档
Dashboard控制台

Revoke and clear the current browser member session

Generated from the checked-in source. Do not edit this reference by hand.

POST /api/v1/auth/browser/logout

Requires the configured HTTPS Origin; supplied Sec-Fetch-Site must be a single same-origin value. Revokes the supplied member session and clears the cookie. Already expired or revoked sessions also clear the cookie successfully. Storage failure does not claim successful revocation or clear the cookie. Responses use Cache-Control no-store.

Operation: revokeBrowserMemberSession.

Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.

JSON
[
{
"memberCookie": []
}
]

Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.

Shell
curl --fail-with-body -X POST "$NIU_ORIGIN/api/v1/auth/browser/logout" \
--cookie "__Host-niu_member_session=$NIU_MEMBER_SESSION" \
-H 'Origin: <ORIGIN>'

Location: header. Required.

JSON
{
"type": "string"
}

No request body is declared.

Session unusable and cookie expired; no response body

Missing or malformed member cookie

Missing or mismatched Origin

Password login not configured

Revocation unavailable; retry before assuming sign-out

Requires the configured HTTPS Origin; supplied Sec-Fetch-Site must be a single same-origin value. Revokes the supplied member session and clears the cookie. Already expired or revoked sessions also clear the cookie successfully. Storage failure does not claim successful revocation or clear the cookie. Responses use Cache-Control no-store.