0

When I return to my site after a period of time -like a few hours - I get 3 PHP warnings like in the screenshot for some reason. When I login/logout, the warnings go away.

enter image description here

[phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1042: Cannot modify header information - headers already sent by (output started at /home/content/60/11957760/html/runicparadise/index.php:22) [phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1042: Cannot modify header information - headers already sent by (output started at /home/content/60/11957760/html/runicparadise/index.php:22) [phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1042: Cannot modify header information - headers already sent by (output started at /home/content/60/11957760/html/runicparadise/index.php:22)

This is the php code from line 22 it's referring to... the other reference seems to be somewhere on my host's server I guess?

<?php 
define('IN_PHPBB', true); 
$phpbb_root_path = './forums/'; 
$phpEx = substr(strrchr(__FILE__, '.'), 1); 
include($phpbb_root_path . 'common.' . $phpEx); 
// Start session management 
$user->session_begin(); 
$auth->acl($user->data); 
$user->setup(); 
?>
runelynx
  • 403
  • 2
  • 4
  • 17

1 Answers1

2

I bet that in your session_begin() you have session_start(). Sessions are usually based on cookies which are 'header data'. If later in your code you use:

header(.....) // to set some additional header

and between session_start and invoking header you echo sth. - there will be issue since you cannot send header after sending data. You may also use session_start twice (and echo in between)

Artur
  • 7,038
  • 2
  • 25
  • 39