I have having a problem where session ids are not being written. Am sorry if this question goes on for a bit long, but I have done quite a few tests to rule out certain things, so thought it was useful to present all of the data that I have.
For each test, I am opening up a new incognito window in Chrome to make sure that cookies/sessions are cleared before starting a new test.
In addition, please note, that the website I am working on has two different languages in two different folders. English and Hebrew.
Everything is working fine in the English side of the site but not in the Hebrew. Some of the 'include' files are in a seperate folder called /php/ which are included both on the Hebrew and English side.
Not sure if relevant, but the .htaccess file contains redirects on both English and Hebrew side which are something like:
RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]
RewriteRule ^categories/(.+) /HE/categories.php?pg=$1&type=$2 [L]
On the php page itself (eg. categories.php), the code starts off:
<?php include_once('header.php');
In header.php, I have:
<?
require_once '../php/config.php';
require_once 'functions.php';
in config.php which is used both on the hebrew and english sides, I have:
<?php
session_start();
echo "--".session_id();
in all cases, the
When I go to the page:
http://www.goo.com/HE/categories/foo
each time I refresh, it echos out a new value for session_id()
In the error log, I am getting:
[23-Oct-2013 04:12:41] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent by (output started at /home/foo/public_html/HE/header.php:1) in /home/foo/public_html/php/config.php on line 2
[23-Oct-2013 04:12:41] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/foo/public_html/HE/header.php:1) in /home/foo/public_html/php/config.php on line 2
Now, I want to stress again, that there is no white space that I am aware of and that the equivalent seems to be working on the english side without a problem.
I have created a file called testsess.php which contains:
<?php
session_start();
echo "--".session_id();
and put it in the HE folder and this works as it should without an error
I am sure that it is something really simple, but been trying different things for hours and hours and am totally stumped.