php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8588 CODE of: Session does not work outside the folder it was created in
Submitted: 2001-01-08 04:16 UTC Modified: 2001-05-11 21:12 UTC
From: neville_lewis at yahoo dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.4 OS: Windows 95
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: neville_lewis at yahoo dot com
New email:
PHP Version: OS:

 

 [2001-01-08 04:16 UTC] neville_lewis at yahoo dot com
I have started a session in a file in one folder however when that page calls another file
in another folder then the session variable does not carry.... I am using the
session_start() statement in every page in the 
other folder ..... 

It works fine with all the files in the same folder that the session was started in, but
when it comes to the files in any other folder it does not work...... 

I am using php4 with Apache on win95 downloaded from php4win.de

If anyone knows about this problem or knows where I can get an answer to it please contact
me at neville_lewis@yahoo.com

I want to write one login script for my site and keep it in one folder and call that in
all the pages in various folders.....

Thanks 

Neville Lewis.




CODE below is of the two files in the 2 different folders 
The variable $val is registered in "f1_file1.php" and 
gets printed in "f1_file2.php" 
BUT NOT IN "f2_file1.php" 

Tell me what is wrong here ? 

I am using php4, Apache, windows95 


=================================== 
FOLDER: /www/session/f1/ 
FILE: "f1_file1.php" 

<?session_start(); 

$val="Hello val"; 

session_register("val"); 
echo "session registered"; 

?> 

----------------------------------- 
FILE: "f1_file2.php" 

<?session_start(); 
echo "displaying session val in SAME FOLDER below<br>"; 
echo $val; 

?> 


===================================== 
FOLDER: /www/session/f2/ 
FILE: "f2_file1.php" 

<?session_start(); 
echo "displaying session val in DIFFERENT FOLDER below<br>"; 
echo $val; 

?> 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-08 16:16 UTC] cynic@php.net
duplicate of #8527
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC