Skip to content

Add support for configurable Clear-Site-Data directive on logout#22729

Draft
jason-p-pickering wants to merge 7 commits into
masterfrom
clear-site-data
Draft

Add support for configurable Clear-Site-Data directive on logout#22729
jason-p-pickering wants to merge 7 commits into
masterfrom
clear-site-data

Conversation

@jason-p-pickering

Copy link
Copy Markdown
Contributor

Implemented a configurable Clear-Site-Data header on logout so deployments can explicitly purge browser caches/storage (or define a custom directive) as part of the sign‑out flow.

This is important for DHIS2 because it is frequently used in sensitive, shared, or resource‑constrained environments, where residual client‑side data can increase privacy risk. Ensuring a clean logout reduces the chance of data leakage between users or sessions. It should be pointed out however, that this will only work at the moment if the user explicitly logouts.

Behavior:

  • If http.clear_site_data is not defined or is blank in the configuration, then no Clear-Site-Data header will be sent on logout.

  • If http.clear_site_data is set to "on", then "cache", "storage" will be sent as the default.

  • Otherwise, if http.clear_site_data is set to anything else (a custom directive) that is what will be sent on the logout action.

@jason-p-pickering
jason-p-pickering marked this pull request as draft January 9, 2026 07:56
@bobjolliffe

Copy link
Copy Markdown
Contributor

makes sense. We should do some analysis of logs to understand how common explicit logging out actually is. I suspect rare enough. Perhaps we can find some annoying ways to "encourage" users to log out.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants