Issue with setcookie with empty string value
Nobody has claimed this yet.
- Dominant language
- XML
- Stars
- 596
- Forks
- 890
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 55
Description
Affected page
Issue description
If the value argument is an empty string, and all other arguments match a previous call to setcookie(), then the cookie with the specified name will be deleted from the remote client. This is internally achieved by setting value to 'deleted' and expiration time in the past.
Steps to reproduce
setcookie( 'abcdef', '', time() + 3600 );
var_dump( headers_list() );
Suggested fix
The bold highlighted part of the doc is wrong, since it will always do that if the cookie value is empty string.
EDIT: it seems the documented behavior was how it worked at least until PHP 5.6, however since some PHP 7 version this changed
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the affected setcookie() page and review the statement about an empty value, especially the highlighted condition. Run the provided PHP snippet if needed to compare the documented behavior with the output. Done means the wording accurately reflects current PHP behavior and the example remains consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100