From: Thies C. Arntzen Date: Wed, 29 Mar 2000 09:36:27 +0000 (+0000) Subject: @- session_start() is now more verbose if headers cannot be send. (Thies) X-Git-Tag: php-4.0RC2~595 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a692f1556812ca16bcc893e20a3fc655bbe33cb6;p=php @- session_start() is now more verbose if headers cannot be send. (Thies) --- diff --git a/ext/session/session.c b/ext/session/session.c index 94cc7dd75a..3a552d21e3 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -36,6 +36,7 @@ #include "ext/standard/datetime.h" #include "ext/standard/php_lcg.h" #include "ext/standard/url_scanner.h" +#include "ext/standard/php_output.h" #include "ext/standard/php_rand.h" /* for RAND_MAX */ #ifdef ZTS @@ -554,7 +555,15 @@ static void _php_session_cache_limiter(PSLS_D) SLS_FETCH(); if (SG(headers_sent)) { - php_error(E_WARNING, "Cannot send session cache limiter - headers already sent"); + char *output_start_filename = php_get_output_start_filename(); + int output_start_lineno = php_get_output_start_lineno(); + + if (output_start_filename) { + php_error(E_WARNING, "Cannot send session cache limiter - headers already sent by (output started at %s:%d)", + output_start_filename, output_start_lineno); + } else { + php_error(E_WARNING, "Cannot send session cache limiter - headers already sent"); + } return; } @@ -581,7 +590,15 @@ static void _php_session_send_cookie(PSLS_D) SLS_FETCH(); if (SG(headers_sent)) { - php_error(E_WARNING, "Cannot send session cookie - headers already sent"); + char *output_start_filename = php_get_output_start_filename(); + int output_start_lineno = php_get_output_start_lineno(); + + if (output_start_filename) { + php_error(E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)", + output_start_filename, output_start_lineno); + } else { + php_error(E_WARNING, "Cannot send session cookie - headers already sent"); + } return; }