Re: PHP 5.0.3 and base64 encoded cookie value issue?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Greetings again,
>  Thanks to richard for pointing out a good way to
> devle
> into the source. It appears after browsing through the
> source that the ' ' (space) is encoded to '+'. Also
> the
> characters '_', '-', '.' do get special treatment.
>
> Obviously, this works great in the scenario where the
> cookie is set by the PHP/Server and retrieved by a
> PHP/Server.
>
> Since the encoding is not mandated by the spec, I
> guess I cannot fault PHP for doing what it does. But I
> am curious as to what led to the design decision to
> encode ' ' to '+'.

I guess they thought + was more pretty than %20
[shrug]

Since you have the source, though, you can at least reverse-engineer a
perfect inverse function, and move on, secure in the knowledge that you
have the exactly correct solution.

Ya got me on the _ - and . though...

Sure hope it meets the Cookie spec...

Hopefully they caught all characters that urlencode does/doesn't handle,
and wedged it into a perfectly valid cookie-encoder. :-)

I think this was done *WAAAAAY* long time ago, before PHP had a
base64encode function, and urlencode was what they had.  If all you have
is a hammer...

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux