[php-src] Issue #15135: session.lazy_write only implemented if user defines custom handler with updateTimestamp method - Incorrect behavior
| From: | shimscharf | Date: | Sun, 28 Jul 2024 03:13:50 +0000 |
| Subject: | [php-src] Issue #15135: session.lazy_write only implemented if user defines custom handler with updateTimestamp method - Incorrect behavior | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247383@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/15135
Author: shimscharf
### Description
The following code:
https://github.com/php/php-src/blob/21e01f3e70308824169632d5a16047f9df52fac9/ext/session/session.c#L515-L522
Will not call updateTimestamp unless PS(mod)->s_update_timestamp exists & is different to the
inbuilt updateTimestamp function (php_session_update_timestamp defined in https://github.com/php/php-src/blob/21e01f3e70308824169632d5a16047f9df52fac9/ext/session/session.c#L1105).
It will always call the standard inbuilt file write handler instead.
Given that session.lazy_write defaults to 1 --> True, the expectation is that the session file
will not be overwritten if there isn't a change in session value. But this will always happen
unless there is a defined custom handler.
### PHP Version
PHP 8.2
### Operating System
Ubuntu 22.04 LTS