Odd Session Weirdness with the include Statement
Posted: Mon Jan 04, 2010 3:00 pm
I'm trying to code a site, that carries a set of session variables.
So I create a header php file with the session_start() command in it:
header.php
So then I include this file in my other two php files, index.php and dashboard.php. I can set session variables in index.php, and doing a print_r($_SESSION) gives the expected output. However, when I go to dashboard.php, only one of the $_SESSION variables carries.
I then double back and take the session_start statement out of the header and put it into the tops of both the index.php and dashboard.php, and it works fine.
Are there any known issues with putting a session_start statement in a header file?
So I create a header php file with the session_start() command in it:
header.php
Code: Select all
session_start();
I then double back and take the session_start statement out of the header and put it into the tops of both the index.php and dashboard.php, and it works fine.
Are there any known issues with putting a session_start statement in a header file?