php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80889 Cannot set save handler when session.save_handler is invalid
Submitted: 2021-03-19 11:41 UTC Modified: 2021-03-19 14:23 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: simon at podlipsky dot net Assigned: cmb (profile)
Status: Closed Package: Session related
PHP Version: 8.0.3, 7.4.16 OS: macos, debian
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: simon at podlipsky dot net
New email:
PHP Version: OS:

 

 [2021-03-19 11:41 UTC] simon at podlipsky dot net
Description:
------------
When `sesssion.save_handler` is set to something unknown eg. 

- 'whatever'
- 'memcached' when memcached is not installed
- Value that reports `Warning: ini_set(): Session save handler "XXX" cannot be found for calling `ini_set('session.save_handler', 'XXX');

Then calling `session_set_save_handler()` has no effect.

Test script:
---------------
Set `sesssion.save_handler` to 'whatever' in `php.ini`


```
<?php

$initHandler = ini_get('session.save_handler');

session_set_save_handler(new MyHandlerImpl());

$setHandler = ini_get('session.save_handler');


echo 'Init Handler is: ' . $initHandler . PHP_EOL;
echo 'Set Handler is: ' . $setHandler . PHP_EOL;
```

Expected result:
----------------
Init Handler is: whatever
Set Handler is: user

Actual result:
--------------
Init Handler is: whatever
Set Handler is: whatever

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-03-19 11:48 UTC] simon at podlipsky dot net
-PHP Version: 8.0.3 +PHP Version: 8.0.3, 7.4.16
 [2021-03-19 11:48 UTC] simon at podlipsky dot net
Reproduced on 7.4.16
 [2021-03-19 13:11 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2021-03-19 14:23 UTC] cmb@php.net
-Status: Assigned +Status: Verified
 [2021-03-19 14:24 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #80889: Cannot set save handler when save_handler is invalid
On GitHub:  https://github.com/php/php-src/pull/6788
Patch:      https://github.com/php/php-src/pull/6788.patch
 [2021-03-19 16:06 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=06bfada99bcff9bd2e3a5e959effa2237c07939b
Log: Fix #80889: Cannot set save handler when save_handler is invalid
 [2021-03-19 16:06 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2021-03-22 21:52 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=838951c2d6612efbf6adeb5b1abc7fced808dc39
Log: Fix #80889: amendment
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 15:01:30 2024 UTC