php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75227 You cannot change the session module's ini settings at this time
Submitted: 2017-09-19 13:50 UTC Modified: 2017-09-19 14:43 UTC
From: k dot michalak at kstudio dot pl Assigned:
Status: Not a bug Package: Session related
PHP Version: 7.2.0RC2 OS: Debian
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: k dot michalak at kstudio dot pl
New email:
PHP Version: OS:

 

 [2017-09-19 13:50 UTC] k dot michalak at kstudio dot pl
Description:
------------
We cannot change session settings after header send

Test script:
---------------
<?php

echo "OK";

ini_set('session.use_cookies', 0);


Expected result:
----------------
OK

Actual result:
--------------
OK
Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/test/test020.php on line 5

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-19 13:55 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2017-09-19 13:55 UTC] requinix@php.net
That's right, you can't change session settings after headers have been sent.

Why do you think this is a bug?
 [2017-09-19 14:32 UTC] k dot michalak at kstudio dot pl
But in php 7.0.22 thereis no problem
 [2017-09-19 14:43 UTC] requinix@php.net
-Status: Feedback +Status: Not a bug
 [2017-09-19 14:43 UTC] requinix@php.net
The new error messages were added in relation to bug #71038.

There may not have been an error in 7.0.22 but the code would not have worked correctly: you simply cannot change most, if not all, session information after output has begun.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC