php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15426 PHPSESSID appended causes error
Submitted: 2002-02-07 07:03 UTC Modified: 2002-02-10 06:35 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: php at barma dot lviv dot ua Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.1.1 OS: Windows 98
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at barma dot lviv dot ua
New email:
PHP Version: OS:

 

 [2002-02-07 07:03 UTC] php at barma dot lviv dot ua
When i start IE and load any my pages, i have error
code on first start, but only in on first start
PHPSESID added to all my lnks

in original -

<script language='JavaScript'>
document.write("<a href=\'http://my.pages/test.php?a=10\' target=\'_top\'>Test</a>");
</script>

but in source i have

<script language='JavaScript'>
document.write("<a href="\?PHPSESSID=1e9d0d00b8269ba57ac9f0203636307a"'http://my.pages/test.php?a=10\' target=\'_top\'>Test</a>");
</script>

and this causes error

i have change in php.ini
 session.use_trans_sid = 1
to
 session.use_trans_sid = 0
but this is not work

i have change in php.ini
url_rewriter.tags         = "a=href,area=href,frame=src,input=src,form=fakeentry"
to
 url_rewriter.tags         = ""
but this is not work too

on Linux-server i have recompile without option -enable-trans-sid and this work fine, but i dont find way to fix this problem on my Windows-server

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-07 23:15 UTC] shiflett@php.net
Why are you using JavaScript to write out a simple link? This just causes confusion when you're trying to explain a bug.

To add PHPSESSID to your links, you want to place it in the query string. So, make your link look like this:

<a href="http://my.pages/test.php?a=10&PHPSESSID=1e9d0d00b8269ba57ac9f0203636307a" target="_top">Test</a>

Hope that helps!

Chris
 [2002-02-08 02:41 UTC] php at barma dot lviv dot ua
no :o)

this JavaScript i cute from one from BannerExchange system that i use on my pages

but if PHPSESSID inserted this code not work and causes error

 - full code is -

<!--Begin of ECHO BannerPlace 468 x 60 code -->
<SCRIPT language="JavaScript">
<!--
var v=navigator.appVersion;
var n=navigator.appName;
un = Math.round((Math.random() * (2000000000)));
if (n=="Microsoft Internet Explorer" && v.substring(0, 1)>="3"){
 document.write("<iframe src=\'http://banner.echo.com.ua/gf.dll?5706&"+un+"\' width=468 height=60 scrolling='no' frameborder=0 vspace=0 hspace=0 marginwidth=0 marginheight=0></iframe>");
 document.write("<");document.write("!--");}
else
  document.write("<a href=\'http://banner.echo.com.ua/gf.dll?click?5706&"+un+"\' target='_top'><img border=0 src='http://banner.echo.com.ua/gf.dll?nf?5706&"+un+"' width=468 height=60 alt='Ukrainian Internet Advertising Centre ECHO'></a>");
//-->
</SCRIPT>
<NOSCRIPT>
<iframe src="http://banner.echo.com.ua/gf.dll?5706&0" width=468 height=60 scrolling='no' frameborder=0 marginwidth=0 marginheight=0>
<A href="http://banner.echo.com.ua/gf.dll?click?5706&0" target=_top><IMG src="http://banner.echo.com.ua/gf.dll?nf?5706&0" border=0 width=468 height=60 alt='Ukrainian Internet Advertising Centre "ECHO"'></A>
</iframe>
</NOSCRIPT>
<SCRIPT language="javascript">
<!-- 
if (n=="Microsoft Internet Explorer" && v.substring(0, 1)>="3") {
document.write("--"); document.write(">"); }
//-->
</SCRIPT>
<!--End of ECHO BannerPlace code -->
 [2002-02-08 02:45 UTC] php at barma dot lviv dot ua
original code is

document.write("<a
href=\'http://banner.echo.com.ua/gf.dll?click?5706&"+un+"\'
target='_top'><img border=0
src='http://banner.echo.com.ua/gf.dll?nf?5706&"+un+"' width=468
height=60 alt='Ukrainian Internet Advertising Centre ECHO'></a>");

and if in this code inserted PHPSESSID

document.write("<a
href="\?PHPSESSID=1e9d0d00b8269ba57ac9f0203636307a"'http://banner.echo.com.ua/gf.dll?click?5706&"+un+"\'
target='_top'><img border=0
src='http://banner.echo.com.ua/gf.dll?nf?5706&"+un+"' width=468
height=60 alt='Ukrainian Internet Advertising Centre ECHO'></a>");

and this insertion causes error
 [2002-02-08 10:50 UTC] shiflett@php.net
It looks like you have two problems then:

1) Your banner server probably doesn't care what the PHPSESSID is.
2) You're still incorrectly passing the PHPSESSID on the URL. Again, this must be in the query string as I showed you originally.

Your link that your JavaScript is writing out (which again is entirely unnecessary) is malformed. This *will* cause an error, and there's nothing PHP can do to save you there. :)
 [2002-02-10 06:35 UTC] php at barma dot lviv dot ua
NO - I DONT NEED THAT PHPSESSID added to my links!
DONT NEED!

i say that on local net (if my web-server running on Windows) this PHPSESSID added to my links, but i DONT NEED this. On my net i have servers with Linux and Windows (Apache,PHP and MySQL) - on Linux server i have recompile source without -enable-trans-sid option, and this works fine - dont added PHPSESSID to my links, but on Windows server this PHPSESSID added - and i DONT NEED this.

in php.ini on Windows based server option session.use_trans_sid dont works,
and url_rewriter.tags too

> You're still incorrectly passing the PHPSESSID on the URL. Again, this must be in the query string as I showed you originally.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 01:01:30 2025 UTC