Weather by You!

Templates and Projects support => Php templates => Topic started by: rhussey on February 15, 2014, 01:15:13 PM

Title: session start error message
Post by: rhussey on February 15, 2014, 01:15:13 PM
I have a clean index.php file and I get the following error:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/58/11287358/html/index.php:1) in /home/content/58/11287358/html/index.php on line 9

http://windsorweather.ca
Title: Re: session start error message
Post by: Mr.Meteo on February 15, 2014, 01:26:45 PM
Hi Rhussey,

I think that you've added something in your page
that cause this problem. Just keep in mind that nothing
could be inserted before this line:

session_start()

Regards,
Jacques
Title: Re: session start error message
Post by: rhussey on February 15, 2014, 07:52:59 PM
Here's what's in the index file:

<?php
$tpl_version = "1.2";
if (isset($_GET['ver'])) {
  echo $tpl_version;
  exit;
   // Date: 2013-08-11
}

session_start(); // start PHP session
// Check if a language has been selected
if (isset($_POST['langue'])) {
  $lang = $_POST['langue'];
  $_SESSION['langue'] = $lang; // store session data
}
elseif(isset($_SESSION['langue'])){
  $lang = $_SESSION['langue']; // Default language
}
else {
  $lang = 'en'; // Default language
  $_SESSION['langue'] = $lang;
}
Title: Re: session start error message
Post by: Mr.Meteo on February 16, 2014, 06:56:33 AM
Hi,

headers already sent meen that something is writed
to the page before the start session command. That could be
a javascript or snippet that you included to add EC warnings.

As this page is the only one to have this problem, I suggest
to take back original file to see if trouble come from modifications
or from server configuration (your redirection page!)

Regards,
Jacques