php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38422 session.use_trans_sid not changeable by ini_set
Submitted: 2006-08-11 10:00 UTC Modified: 2006-08-11 10:36 UTC
From: strube at physik3 dot gwdg dot de Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.4.3 OS: Solaris 9 (SPARC)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: strube at physik3 dot gwdg dot de
New email:
PHP Version: OS:

 

 [2006-08-11 10:00 UTC] strube at physik3 dot gwdg dot de
Description:
------------
In PHP 4.4.2 and 4.4.3 (cannot test earlier ones any more), the option session.use_trans_sid cannot be changed by function ini_set, but can be changed using php.ini or the command-line option -d. Also ini_set always returns 0 as the old value for session.use_trans_sid, even if it was set to 1. (BTW, this causes test ext/session/tests/bug36459.phpt to fail -- not because of bug 36459, of course.)
The bug persists even on a second call to ini_set (unlike bug #30422).
Configuration:
env CC=/opt/SUNWspro/bin/cc CFLAGS=-xO2 \
./configure  --enable-discard-path --enable-force-cgi-redirect --with-ndbm --with-dba --with-db --with-db2=/opt/dpiwww/apache --with-mysql=/opt/dpiwww/mysql --enable-sysvsem --enable-sysvshm --with-exec-dir=/opt/dpiwww/php/bin --with-config-file-path=/opt/dpiwww/php/lib --prefix=/opt/dpiwww/php --disable-debug --with-zlib --with-bz2 --with-gd --with-jpeg-dir=/usr/sfw --with-png-dir=/usr/sfw --with-xpm-dir=/usr/openwin --with-freetype-dir=/usr/sfw --enable-gd-native-ttf


Reproduce code:
---------------
*** Script 1:
<?php
printf("%d\n",ini_get('session.use_trans_sid'));
printf("%d\n",ini_set('session.use_trans_sid',1));
printf("%d\n",ini_get('session.use_trans_sid'));

*** Script 2:
<?php
printf("%d\n",ini_get('session.use_trans_sid'));
printf("%d\n",ini_set('session.use_trans_sid',1));
printf("%d\n",ini_get('session.use_trans_sid'));

Expected result:
----------------
*** Script 1:
If previously 0:
0
0
1
If previously 1:
1
1
1

*** Script 2:
If previously 0:
0
0
0
If previously 1:
1
1
0

Actual result:
--------------
*** Both Scripts:
If previously 0:
0
0
0
If previously 1:
1
0
1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-11 10:02 UTC] strube at physik3 dot gwdg dot de
Correction (Script 2 should set to 0, not to 1):
*** Script 2:
<?php
printf("%d\n",ini_get('session.use_trans_sid'));
printf("%d\n",ini_set('session.use_trans_sid',0));
printf("%d\n",ini_get('session.use_trans_sid'));
 [2006-08-11 10:15 UTC] tony2001@php.net
ini_set() returns FALSE, not 0 and this is expected since you cannot change it using ini_set() as the flag is PHP_INI_SYSTEM|PHP_INI_PERDIR.

 [2006-08-11 10:26 UTC] strube at physik3 dot gwdg dot de
Then the documentation is wrong, which states PHP_INI_ALL in
"Appendix G. php.ini directives".
Also, in the Makefile (line 154), option -d 'session.use_trans_sid=1' must be added for the run-tests.php call in order to prevent failure of ext/session/tests/bug36459.phpt.
 [2006-08-11 10:31 UTC] strube at physik3 dot gwdg dot de
Sorry, I overlooked the last column of the table in Appendix G:
PHP_INI_ALL in PHP <= 4.2.3. PHP_INI_PERDIR in PHP < 5.

But the Makefile has still to be changed for 4.4.3.
 [2006-08-11 10:36 UTC] tony2001@php.net
The test is fixed in CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 13:01:32 2024 UTC