php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28256 trans-sid not reliable (irregular appendix to absolute url on localhost)
Submitted: 2004-05-03 00:53 UTC Modified: 2005-01-26 04:50 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: webmaster at roydencom dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.0.0RC2 OS: Linux MDK10
Private report: No CVE-ID: None
 [2004-05-03 00:53 UTC] webmaster at roydencom dot com
Description:
------------
Even if I'm runing smarty I think the following issue is clearly php-related.

For mod_rewrite-reasons I need absolute url here so although having trans-sid enabled I have to append the SID myself:
it looks as if php tries to add the sessionid in just one case (not every time the same one) despite of having an absolute url.

if I add an any masked entity like   the extra &PHPSESSID=dissapears.

Reproduce code:
---------------
//smarty initialisation in an include
if(empty($_COOKIE[CCNAME])) $this->assign("sessionstring","?".SID);
$this->assign("servername",$_SERVER["SERVER_NAME"]);
//in the template
{foreach from=$nav_produkte item=menupunkt}
<a href="http://{$servername}/produkte/{$menupunkt.urlname}.html{$sessionstring}">{$menupunkt.displayname|default:$menupunkt.urlname}</a><br>
{/foreach}

Expected result:
----------------
<a href="http://myhost.local/produkte/indien.html?PHPSESSID=ep0od8amd17te5132usq3f0l73">Indien</a><br>
<a href="http://myhost.local/produkte/thailand.html?PHPSESSID=ep0od8amd17te5132usq3f0l73">Thailand</a><br>
<a href="http://myhost.local/produkte/china.html?PHPSESSID=ep0od8amd17te5132usq3f0l73">China</a>

Actual result:
--------------
href="http://myhost.local/produkte/indien.html?PHPSESSID=ep0od8amd17te5132usq3f0l73">Indien</a><br>
<a href="http://myhost.local/produkte/thailand.html?PHPSESSID=ep0od8amd17te5132usq3f0l73"&PHPSESSID=ep0od8amd17te5132usq3f0l73>Thailand</a><br>
<a href="http://myhost.local/produkte/china.html?PHPSESSID=ep0od8amd17te5132usq3f0l73">Astro</a><br>k23bn50u6">China</a><br>

//because smarty-side $sessionstring being "?PHPSESSID=.+" it looks like a clear php-misbehaviour

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-03 01:41 UTC] webmaster at roydencom dot com
it's not true that the extra &PHPSESSIS dissapears.
I do not get it awy.
I do not think it's different on a remote host.
 [2005-01-26 04:50 UTC] sniper@php.net
User error. (don't try to outsmart the tool..just code the way you're supposed to code: RTFM)

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sun Feb 08 17:00:01 2026 UTC