I put error_reporting(E_ALL); in the top of a php program.
I get this:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/fwsprinkler/public_html/fwsprinklercdb.info/parts_dols.php:50) in /home/fwsprinkler/public_html/fwsprinklercdb.info/config.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at /home/fwsprinkler/public_html/fwsprinklercdb.info/parts_dols.php:50) in /home/fwsprinkler/public_html/fwsprinklercdb.info/config.php on line 53
Attached are 3 scripts; the top of the one being executes, part_dols.php & config.php (courtesy of an EE expert).
I took what Dave said & it seemed to work. I no longer got those messages.
However, what I'm trying to do, based on Ray's Remember me cookie concept, does not work.
See attached. This file is included in the main program. I want the remember me timeout set to 2 hours in the "real" case but I set it to 30 minutes for this test.
Note that if the session 'uid' is not set, & the cookie is NOT set, I am trying to redirect to index.php. It doesn't do that, it returns to the program that includes config.php.
In that (calling) program, I have the following:
include "config.php";
$cookie_name = "uuk";
if(!isset($_COOKIE['uuk'])) {
echo 'Cookie with name "' . $cookie_name . '" does not exist...<br>';
} else {
echo 'Cookie with name "' . $cookie_name . '" value is: ' . $_COOKIE[$cookie_name] . "<br>";
}
I waited over 30 minutes, refreshed the page. The cookie is gone, but it DOES not redirect.
https://www.experts-exchange.com/Programming/Languages/Scripting/PHP/A_4423-Warning-Cannot-modify-header-information-headers-already-sent.html