Bug #18000 Updated: localized http header request includes variable scope
| From: | rasmus@php.net | Date: | Wed, 26 Jun 2002 18:50:04 +0000 |
| Subject: | Bug #18000 Updated: localized http header request includes variable scope | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-12150@lists.php.net to get a copy of this message | ||
ID: 18000
Updated by: rasmus@php.net
Reported By: code@4arrow.com
Status: Bogus
Bug Type: Feature/Change Request
Operating System: UNIX
PHP Version: 4.1.2
New Comment:
Oh, and to get your sessions to persist across a url file open, simply
pass your SID along.
Previous Comments:
------------------------------------------------------------------------
[2002-06-26 14:48:51] rasmus@php.net
I don't understand why you call this a header http request, but
whatever. So you want
include 'http://local.domain/file.php'
to act like
include 'file.php'
if local.domain happens to be the a local domain? Seems to me like
this is something that you should be checking at the application level.
Why use a url when the file is local? We could add a check, but it
would add extra dns calls to every url file operation and I don't think
it is worth it.
------------------------------------------------------------------------
[2002-06-26 14:38:34] code@4arrow.com
Rasmus the HTTP header request is used in all PHP methods that request
a file with a HTTP or full LINK even if it is local.
Such as fopen(), file(), readfile(), include, require, include_once,
require_once. All of these can include files with a absolute URI.
FYI, Sessions don't persist from one http session to another even
inside the same domain when one file is included within another via a
absolute url.
------------------------------------------------------------------------
[2002-06-26 14:31:22] rasmus@php.net
This made absolutely no sense to me. If someone else can make sense of
this, feel free to unbogus it.
What in the world do you mean by, "A PHP file that includes a local
file via a HTTP header request" ?
As in header('Location: http://local.domain/file.php') ?
That is a client-side redirect which means the remote browser is going
to make a completely separate request which may or may not come back to
the same process or even the same physical server in a load-balanced
architecture. Expecting any sort of variable persistency across
client-side redirects is rather silly. This is what sessions are for.
------------------------------------------------------------------------
[2002-06-26 14:17:27] code@4arrow.com
A PHP file that includes a local file via a HTTP header request usign
the full and absolute local URL (http and domain) is seen as a local
call from with the server and treated as a separate session and PHP
parser run from the existing PHP run that the include is beign
requested within.
This changes the $_SERVER['REMOTE_ADDR'] variant to the
$_SERVER['SERVER_ADDR'] variant which is technically accurate but
practically useless.
Also all exisitng sessions or cookies are no longer available to the
included local file because calling it via a absolute URI caused a http
header request which I suppose creates a new session and extraneous
server load. How about viewing absolute URIs in their context, if they
are on the same domain/server to bear that in mind for the benefit of
the developer?
Now, I understand the need for a unique header request to reset new env
variables but at the same time options are a good thing. How about
both? A full URI can call both a local php file that retains the
variables scope of its parent as well as one that doesn't or even
better yet a new unique version prefix is added to the new HTTP header
request and its created env variables and it is not viewed in isolation
but as a part of an existing process.
The request feature is to be able to call a absolute URL
http://4arrow.com/test/test/php within an existing PHP
script both on
the same domain name and server name that has access to all the preset
variables above it as well as unique variables within as a new unique
HTTP request, lastly after it all variables from before it are also
still available.
Basically to retain the variable scope across absolute HTTP requests
within local scripts that call local uris.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18000&edit=1