NYCPHP Meetup

NYPHP.org

[nycphp-talk] transparent SIDs fail with a colon ??

Allen Shaw ashaw at iifwp.org
Thu Mar 3 13:33:13 EST 2005


Hi Folks,

Here's a surprising phenomenon I'm getting when using transparent 
session IDs, one that makes no sense to me.  Here are two hyperlinks on 
the same page, as they are originally coded:

> <a href="index.php?template=welcome&amp;submitid=32:67">Home</a> |
> <a href="logout.php?template=welcome&amp;submitid=32.67">Sign Out</a> | 
>
Now, if we use transparent SIDs, PHP will transform these like so:

> <a href="index.php?template=welcome&amp;submitid=32:67">Home</a> |
> <a href="logout.php?template=welcome&amp;submitid=32.67&amp;PHPSESSID=7e647029bccb9d34fc0b0b0aa6e6a5d0">Sign Out</a> | 
>
Notice that the first link doesn't get the form_Session argment added on 
to the URL -- only the second one.  How come?  It's the colon.  The 
colon in "submitid=32:674105001109864182" apparently screws up PHP's 
attempts to insert the session ID into the URL.  If you just take out 
the colon, you're fine; but use a colon and it's no dice.

I also tried using "&#58;" instead of an actual colon, and I get even 
crazier results.  PHP inserts the SID argument in the *middle* of the 
URL just before the "&#58;" entity, like so:

><a href="index.php?template=welcome&amp;submitid=32&amp;&amp;PHPSESSID=7e647029bccb9d34fc0b0b0aa6e6a5d0#58;67">Home</a>


Seems like a bug, but I couldn't find anything on it (bugs.php.net, 
google).  Is this just weird, or am I missing something? (Experience 
shows that it's more often the latter than the former...)

- Allen

-- 
===========================================================
Allen Shaw                                  ashaw at iifwp.org
IIFWP Data and                           914.631.1331 x.106
    IT Services                        http://www.iifwp.org




More information about the talk mailing list