Bug #74892 [Com]: Url Rewriting (trans_sid) not working on urls that start with #

From: Date: Tue, 11 Jul 2017 18:54:15 +0000
Subject: Bug #74892 [Com]: Url Rewriting (trans_sid) not working on urls that start with #
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209996@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74892&edit=1

 ID:                 74892
 Comment by:         andrew dot nester dot dev at gmail dot com
 Reported by:        drchuck at gmail dot com
 Summary:            Url Rewriting (trans_sid) not working on urls that
                     start with #
 Status:             Verified
 Type:               Bug
 Package:            Session related
 Operating System:   Mac OS/X
 PHP Version:        7.1.7
 Block user comment: N
 Private report:     N

 New Comment:

Thanks for reporting the issue! I've just sent PR fixing this.


Previous Comments:
------------------------------------------------------------------------
[2017-07-10 15:18:41] requinix@php.net

Affects 7.1+ https://3v4l.org/U96sK

------------------------------------------------------------------------
[2017-07-10 14:30:03] drchuck at gmail dot com

Description:
------------
When there is a URL that starts with "#" in an anchor tag, PHP 7.1.1 still adds the
PHPSESSID parameter like this:

<p><a href="index.php?PHPSESSID=a17309afea8f2791078fc046cce5fa56">Click This
Anchor Tag!</a></p>
<p><a href="#place/?PHPSESSID=a17309afea8f2791078fc046cce5fa56">Internal
link</a></p>
<p>Our Session ID is: a17309afea8f2791078fc046cce5fa56</p>
<p>Our PHP Version is: 7.1.1</p>

Test script:
---------------
<?php
    ini_set('session.use_cookies', '0');
    ini_set('session.use_only_cookies',0);
    ini_set('session.use_trans_sid',1);
    session_start();
?>
<p><a href="index.php">Click This Anchor Tag!</a></p>
<p><a href="#place">Internal link</a></p>
<p>Our Session ID is: <?= session_id() ?></p>
<p>Our PHP Version is: <?= phpversion() ?></p>

Expected result:
----------------
<p><a href="index.php?PHPSESSID=aec2a7538bfe295d6a6c9ff70c42f8eb">Click This
Anchor Tag!</a></p>
<p><a href="#place">Internal link</a></p>
<p>Our Session ID is: aec2a7538bfe295d6a6c9ff70c42f8eb</p>
<p>Our PHP Version is: 5.6.28</p>

This is the output from the script on 5.6.28.  Note that '#place" does not get the session
applied.

Actual result:
--------------
<p><a href="index.php?PHPSESSID=a17309afea8f2791078fc046cce5fa56">Click This
Anchor Tag!</a></p>
<p><a href="#place/?PHPSESSID=a17309afea8f2791078fc046cce5fa56">Internal
link</a></p>
<p>Our Session ID is: a17309afea8f2791078fc046cce5fa56</p>
<p>Our PHP Version is: 7.1.1</p>

This is the output from 7.1.1 (sorry I don't have easy access to 7.1.7)


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=74892&edit=1


Thread (7 messages)

« previous php.bugs (#209996) next »