php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28923 session_start() problem after flush()
Submitted: 2004-06-25 16:34 UTC Modified: 2004-06-29 17:54 UTC
From: joula at sztaki dot hu Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.7 OS: Windows XP
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joula at sztaki dot hu
New email:
PHP Version: OS:

 

 [2004-06-25 16:34 UTC] joula at sztaki dot hu
Description:
------------
Hello,

There is a problem with session_start() when I call it after flush().

Thanks.

Reproduce code:
---------------
<?
flush();
session_start();
echo "here";
?>

Expected result:
----------------
Do not get warning.

Actual result:
--------------
Warning: session_start(): Cannot send session cookie - headers already sent in ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-29 17:54 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

when you call flush() even if nothing was flushed PHP sets 
a flag indicating that body of the message was sent and no 
more headers can be sent. This is why you get an error from 
session_start() which attempts to send http headers. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC