SESS constant a not that good idea?
| From: | Boris Erdmann | Date: | Fri, 11 Jun 1999 23:50:32 +0000 |
| Subject: | SESS constant a not that good idea? | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1517@lists.php.net to get a copy of this message | ||
First of all i am not that familiar with the constants
behaviour of PHP:
will a define("SESS","sometext") and later <?php SESS?>
not produce a syntax error as sometext is not supposed
to be valid PHP source?
dont we need a clever way to generally do a
<a href="<?php surl("FUNURL")">
in all scripts and surl will do the right thing, i.e:
- append "?SESSID=sess_id" if no "?" was in FUNURL
- append "&SESSID=sess_id" if a "?" was in FUNURL
- do not append anything if "SESSID=sess_id" was already
part of FUNURL (due to FUNURL being derived from
$PHP_SELF or the like)
- do not append anything if the session id propagation
method was determined to be via cookie earlier in the
script / or by PHP ini/config method?
For this kind of cleverness a simple constant will not
suffice.
We have something like surl() in PHPLIB because we want
to be able to write scripts independent from the session
id propagation method. Moreover: a clever propagation
method detection mechanism will do the rest for us.
We dont care for the propagation method.
That mechanism resides in a prepend file and the surl()
like function decides if there has to be done modification
to the given url.
Just some thoughts...
Boris