|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-06-28 09:56 UTC] tony at marston-home dot demon dot co dot uk
Description: ------------ When running a script in CLI mode I cannot open a new session if any headers have already been sent. According to bug #28923 the original message concerned the session cookie, but cookies are only used when running the script in a browser. If I am running in CLI mode there is no browser, so cookies should be irrelevant, which means that session_start() should not fail. Test script: --------------- <? flush(); session_start(); echo "here"; ?> Expected result: ---------------- Do not get warning. Actual result: -------------- session_start(): cannot start session when headers already sent PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Feb 03 19:00:01 2026 UTC |
if(PHP_SAPI !== 'cli' && headers_sent() === false) { session_start(); }