php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2735 session variables wont register in some cases
Submitted: 1999-11-17 08:24 UTC Modified: 1999-11-18 21:36 UTC
From: tojo at jogin dot nu Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Beta 2 OS: linux 6.1
Private report: No CVE-ID: None
 [1999-11-17 08:24 UTC] tojo at jogin dot nu
If you try to register a session variable in a script that is NOT in the very root of your webserver, it wont register.
If the script is in the webserver root however (default: htdocs) it will..

/tomas

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-17 14:39 UTC] sas at cvs dot php dot net
That is fixed in beta 3.
 [1999-11-18 08:02 UTC] tojo at jogin dot nu
No. the problem persists in php4 beta 2.
If a session variable is set in the root folder of the website, sure, great, it will work wherever you are on that website.
If, however, a session variable is set in a subfolder on that domain, it will also only work in its subfolders respectively, but if you try to read that variable in the root folder, its a no-no, cause its empy.

http://hem2.passagen.se/jogin/test.htm has a bunch of links to my php site, click on one of the documents in a SUBFOLDER, then from that document click around, the session variables values are printed on the bottom of the page, you will see that they are reset ever time you go to a different subfolder, until you go to the very root folder, then they are permanently set. Because, as i stated, session variables are per folder and its subfolders respectively.

 [1999-11-18 13:39 UTC] sas at cvs dot php dot net
Please upgrade to beta 3 (that is not equal to beta 2). The cookie is automatically set to be valid for the whole server.
 [1999-11-18 14:15 UTC] tojo at jogin dot nu
Please listen for just one minute, re-read my post.
PHP 4.0 BETA 2.
Ok ?

I have a script to demonstrate this if you dont believe me.

http://hem2.passagen.se/jogin/test.htm has a couple of links. Choose a link in a subfolder.

You now arrive at a php4 powered page with links to other subfolders and also to the very root of the webserver.
A few lines down is a line like : s_first_encounter NOT empty: <value>
Value is the script name that was FIRST read on this domain. Watch carefully its behaviour when selecting a link from this page to another FOLDER, it CHANGES. Whilst being in this folder, the value is intact, but if you change to another folder, bam, it changes again, until you go to the very document root, where it is set permanently, because a session variable is PER SESSION AND PER FOLDER AND ITS SUBFOLDERS RESPECTIVELY.

If you dont believe i use php4, check http://jogin.nu/phpinfo.php.

/sincerely, Tomas Jogin
 [1999-11-18 14:16 UTC] tojo at jogin dot nu
Im so sorry, forgive me for my bad reading, is beta3 out? Where?
Please tell me where i can download it!

/tomas
 [1999-11-18 21:36 UTC] sas at cvs dot php dot net
Ok, hopefully this is the final close of this bug report. :-)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 18:01:28 2024 UTC