Bug #80906 [Opn]: session.use_cookies = false still require not sent headers

From: Date: Thu, 25 Mar 2021 15:28:34 +0000
Subject: Bug #80906 [Opn]: session.use_cookies = false still require not sent headers
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232992@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80906&edit=1

 ID:                 80906
 Updated by:         cmb@php.net
 Reported by:        sailormax at inbox dot lv
 Summary:            session.use_cookies = false still require not sent
                     headers
 Status:             Open
 Type:               Bug
 Package:            Session related
 Operating System:   Any
 PHP Version:        8.0.3
 Block user comment: N
 Private report:     N

 New Comment:

I'd rather make session.use_cookies mandatory, than making the
session handling more complex to support this scenario.


Previous Comments:
------------------------------------------------------------------------
[2021-03-25 14:07:30] rtrtrtrtrt at dfdfdfdf dot dfd

you simply change the setting way too late

------------------------------------------------------------------------
[2021-03-25 14:01:39] sailormax at inbox dot lv

Description:
------------
If try to setup session-functions to work without cookies, they still doesn't work when headers
have already been sent

Test script:
---------------
<?
  print "foo";
  ini_set("session.use_cookies", 0);
  session_name("myname");
?>

Expected result:
----------------
foo


if user turn off "session.use_cookies", php has not to check headers in ini_set() and in
any session-functions.

Actual result:
--------------
foo
Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in
D:\foo.php on line 3

Warning: session_name(): Session name cannot be changed after headers have already been sent in
D:\foo.php on line 4


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80906&edit=1


Thread (4 messages)

« previous php.bugs (#232992) next »