Re: base64-encoding in cookies?

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

 



Robert Cummings writes:

> Dear numnutz, get off your lazy arse and read the doc for yourself:
>
>     http://wp.netscape.com/newsref/std/cookie_spec.html
> 
> It clearly states:
> 
>     NAME=VALUE
> This string is a sequence of characters excluding semi-colon, comma and
> white space. If there is a need to place such data in the name or value,
> some encoding method such as URL style %XX encoding is recommended,
> though no encoding is defined or required.
> 
> There, it left the encoding up to whoever is decoding it. Now feel free
> to take your troll ass and hide under a bridge someplace.

Actually, wouldn't you say it is left up to whoever is sending the cookie?
But more on that later.

Here is my point of view, if you are interested.  When the specification
for a language reads "encoding is recommended, but not required", then
it is leaving the decision to encode or not to encode up to the sender.
The sender is in the driver's seat and the receiver must follow suite.
(Side note: this is an inherently BAD specification since it requires
out-of-band agreement between the sender and receiver, and this is what
puts the developers of PHP in such a tough position.)  The receiver must
be able to handle either case.  But PHP does not permit this.  Instead,
PHP, in an attempt to avoid the chaos inherent a bad spec, has made the
decision for the sender.  The sender must encode, and has no choice.
I think this is at the root of my frustration.  I want control. :)
Also, keep in mind that in my case the sender is a third party over
whom I have no control.  Given a spec like this, I prefer cooperation
between sender and receiver rather than a decision by fiat made by the
programming language.

Now that I have seen the spec (thank you!), I can at least understand
why the PHP developers made the decision they did.  I still disagree
with it, but I was seeking only an understanding, and I have found that.
I hope you will agree I was not trolling here.

Oh.  One more thought.  If you wish to argue that PHP does provide
for both cases with $_COOKIE and $_SERVER['HTTP_COOKIE'], then I will
grudgingly agree with you.  See we can agree. :)  In that case, all I ask
is for a little documentation.  Is the distinction in these two variables
documented somewhere?  I have looked and looked and have come up empty.
I am asking this question with humility and sincerity.  I am asking it
because I honestly wish to learn.  I think you have misjudged my motives
and my character.

Thank you,
Fletcher

-- 
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