Re: Session duplicated in url
| From: | BB | Date: | Tue, 18 Jun 2002 11:32:39 +0000 |
| Subject: | Re: Session duplicated in url | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-85293@lists.php.net to get a copy of this message | ||
Then turn it off?
"Marcus Boerger" <marcus.boerger@t-online.de> wrote in message
news:5.1.0.14.2.20020617223251.00b7ffc8@wheresmymailserver.com...
> When i have someone deactivating the cookies i get multiple PHPSESSIONID
> queries.
>
> What i do: I have a site that propageates some data with query strings.
> These i read from
> $_SERVER['QUERY_STRING'], modify and write them back as href. Everything
is
> working
> fine but when cookies are disabled i have the PHPSESSIONID repeated.
>
> Example from logfile:
> 137.226.156.172 - - [17/Jun/2002:22:03:24 +0200] "GET
>
/?4&PHPSESSID=8db991d1a3b1ee1a7a497b7644956085&PHPSESSID=8db991d1a3b1ee1a7a4
97b7644956085&PHPSESSID=8db991d1a3b1ee1a7a497b7644956085&PHPSESSID=8db991d1a
3b1ee1a7a497b7644956085&PHPSESSID=8db991d1a3b1ee1a7a497b7644956085&PHPSESSID
=8db991d1a3b1ee1a7a49
>
7b7644956085&PHPSESSID=8db991d1a3b1ee1a7a497b7644956085&PHPSESSID=8db991d1a3
b1ee1a7a497b7644956085
> HTTP/1.1" 200 2675
>
"/?3&PHPSESSID=8db991d1a3b1ee1a7a497b7644956085&PHPSESSID=8db991d1a3b1ee1a7a
497b7644956085&PHPSESSID=8db991d1a3b1ee1a7a497b7644956085&PHPSESSID=8db991d1
a3b1ee1a7a49
>
> Example code snippet:
>
> $server_query = $_SERVER['QUERY_STRING'];
> $pos = strpos($server_query,'&');
> $q_ext = '';
> if ($pos !== false) {
> $extern_query = substr($server_query,$pos);
> } else {
> $extern_query = '';
> }
> $idx_href = './?-'.$extern_query;
>
> echo "<a href='$idx_href'>" ......
>
> What i do is cutting the first query entry which i allways have. Setting a
> new one
> and adding rest of original query.
>
> Suppose i have "/?4" this would be rewritten with session id to
> "/?4&PHPSESSID=xxx"
> The snipped above sees '&' present and sets $extern_query to
"&PHPSESSID=xxx".
> Then it sets $idx_ref to "./?-&PHPSESSID=xxx"
>
> So i suggest there could be something wrong with detection of query
strings
> that have
> entries without an equal sign?
>
> Any hints what i am doing wrong or what is wrong?
>
> marcus
>
>
>
> --------->>> mailto:marcus.boerger@post.rwth-aachen.de
> <<<------------
> "Wir sind allzumal Tiere unter Tieren, Kinder der Materie wie sie,
> nur wehrloser. Doch da wir im Unterschied zu den Tieren wissen,
> dass wir sterben muessen, wollen wir uns auf jenen Augenblick vorbereiten,
> indem wir das Leben geniessen, das uns durch Zufall und vom Zufall gegeben
> ist."
> Umberto Eco, Die Insel des vorigen Tages
> --------------->>> http://www.marcus-boerger.de
> <<<-------------------
> ---------->>> Tel. 0241 / 874 09-7 ### 0179 / 29 14 980 <<<----------