Reply to Re: [PHP] PHP 5.0.3 and base64 encoded cookie value issue?

Your name:

Reply:


Posted by Richard Lynch on 10/19/43 11:10

> 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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация