Skip to content

refactor: lazily load CSP and Cookie only when needed by Response#10121

Open
paulbalandan wants to merge 2 commits intocodeigniter4:4.8from
paulbalandan:lazy-load-csp-and-cookie
Open

refactor: lazily load CSP and Cookie only when needed by Response#10121
paulbalandan wants to merge 2 commits intocodeigniter4:4.8from
paulbalandan:lazy-load-csp-and-cookie

Conversation

@paulbalandan
Copy link
Copy Markdown
Member

Description
Closes #8201

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan paulbalandan added the refactor Pull requests that refactor code label Apr 18, 2026
@github-actions github-actions bot added the 4.8 PRs that target the `4.8` branch. label Apr 18, 2026
@paulbalandan paulbalandan linked an issue Apr 18, 2026 that may be closed by this pull request
Comment thread system/HTTP/Response.php
* Called by every cookie-related method so cookie machinery is only
* loaded when the developer actually interacts with cookies.
*/
private function initializeCookieStore(): CookieStore
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small clarification: for initialization, it is not necessary to return something (void). If you use return for the call chain, perhaps you should rename it to getCookieStore()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, you're right!

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

Labels

4.8 PRs that target the `4.8` branch. refactor Pull requests that refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev: Cookie and CSP should be loaded only when used

3 participants