Question : PHP SESSION doesn't pass value to sub or upper directory on Linux

Hi guys,
I have a problem but I don't know why and where to look at it.
I have a php script in main directory and the script include a php file in the sub-directory. The file in the main directory is called index.php and the include file is login.php. Index.php calls login function and the function generates $_SESSION['user']. The problem is that the session value is stays in the sub-directory where the fuction is. I tested the session value and the session value was created but I cannot use the session in the main directory. I have some other php scripts in the same sub directory and they are passing the session value but not second sub directory and main directory. The session value stays in same folder where it was created. I checked same scripts on the XP and it works fine. In this case, where should I look for?

Answer : PHP SESSION doesn't pass value to sub or upper directory on Linux

The session should not be affected by the directory its in.  I'd make sure there's a session_start() at the top of every page.  Also make sure you have the correct file and folder permissions.  Also make sure that one of your scripts isn't unsetting the session value you are looking for.  It's hard to say since you did not post that much information.  Can you post the actual scripts?
Random Solutions  
 
programming4us programming4us