php-src/ext/session
Calvin Buckley 18dee43e02
Add SAPI_HEADER_DELETE_PREFIX, make ext/session use it (#18678)
* Add SAPI_HEADER_DELETE_PREFIX operation

The session ext currently munges into the linked list of headers
itself, because the delete header API is given the key for headers to
delete. The session ext wants to use a prefix past the colon separator,
for i.e. "Set-Cookie: PHPSESSID=", to eliminate only the specific cookie
rather than all cookies.

This changes the SAPI code to add a new header op to take a prefix
instead. Call sites are yet unchanged. Also fix some whitespace.

* Simplify cookie setting code in ext/session

Use the modern SAPI header ops API, including the remove prefix op we
just added.

* [ci skip] Remove redundant and unnecessary comment

The purpose of this is clear, and after refactoring, the special case is
no longer there, so it has no value.

* Un-deprecate simple add/replace header API, use it

Suggestion from Jakub.

* Restore the optimization removing session cookies had

I don't think this needs to be special cased with the parameter.

* Move setting header length to caller

Suggestion from Jakub.

* [ci skip] adjust tab count

It may be better to use spaces in here instead.

* Use session_cookie_len rather than calling strlen
2025-07-31 19:52:04 -03:00
..
tests Deprecate returning non-string values from a user output handler (#18932) 2025-07-07 14:31:13 -07:00
config.m4 Add date extension to dependencies (#15475) 2024-08-18 16:47:57 +02:00
config.w32 Add date extension to dependencies (#15475) 2024-08-18 16:47:57 +02:00
CREDITS
mod_files.bat Remove forgotten obsolete session INI directives (#14238) 2024-05-15 17:01:15 +02:00
mod_files.c Merge branch 'PHP-8.2' into PHP-8.3 2024-04-20 17:11:33 +01:00
mod_files.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
mod_files.sh Update http links to https and sync www.php.net URLs (#14854) 2024-07-07 04:23:08 +02:00
mod_mm.c Session: Use zend_string* consistently for key in mod_mm 2022-05-29 15:24:06 +01:00
mod_mm.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
mod_user.c Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
mod_user.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
mod_user_class.c [skip ci] Remove wrappers comments in session ext (#18017) 2025-03-13 12:14:31 +00:00
php_session.h ext/session: get rid of sname_len field 2025-07-06 17:21:00 +01:00
session.c Add SAPI_HEADER_DELETE_PREFIX, make ext/session use it (#18678) 2025-07-31 19:52:04 -03:00
session.stub.php Refactor session_set_save_handler() 2022-10-22 12:47:34 +01:00
session_arginfo.h Fix registration of internal readonly child classes (#15459) 2024-08-24 12:36:54 +02:00