Skip to content

How to flush cookies as of PHP8 - #5791

Open
divinity76 wants to merge 2 commits into
php:masterfrom
divinity76:patch-21
Open

How to flush cookies as of PHP8#5791
divinity76 wants to merge 2 commits into
php:masterfrom
divinity76:patch-21

Conversation

@divinity76

Copy link
Copy Markdown
Contributor

Prior to php8, curl_close($ch) would flush the cookie list. Code that depend on the cookie list to be flushed on curl_close() breaks on PHP8. Document an alternative way to flush the cookie list: curl_setopt($ch, CURLOPT_COOKIELIST, "FLUSH");

Prior to php8, curl_close($ch) would flush the cookie list. Code that depend on the cookie list to be flushed on curl_close() breaks on PHP8. Document an alternative way to flush the cookie list:
curl_setopt($ch, CURLOPT_COOKIELIST, "FLUSH");
Copilot AI lite review requested due to automatic review settings August 25, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the curl_close() documentation to address a behavioral change in PHP 8+ where curl_close() no longer destroys the handle (and therefore no longer triggers cookie persistence implicitly), and to document an explicit way to flush cookies.

Changes:

  • Add a note to curl_close() docs describing how to flush cookies via CURLOPT_COOKIELIST "FLUSH".
  • Minor whitespace/formatting cleanup in the XML.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread reference/curl/functions/curl-close.xml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread reference/curl/functions/curl-close.xml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants