Re: Extralight browser-webserver communication via cookies (+) [message #172671 is a reply to message #172662] |
Thu, 24 February 2011 13:37 |
Michael Fesser
Messages: 215 Registered: September 2010
Karma:
|
Senior Member |
|
|
.oO(n00m)
> It could replace 97% of all xmlhttprequest stuff.
Not really. Where's this number coming from?
> Tested in IE and FF.
> Below just a minimalistic example of the whole idea.
I consider it nonsense. It makes web applications even more unreliable
and doesn't save anything. Whether you put your content in a misused
cookie or in the message body doesn't make much of a difference.
> ====================================================
> <?php // me.php
> if (array_key_exists('sel', $_COOKIE) && $_COOKIE['sel']) {
> setcookie('sel', 'You_chose_'.$_COOKIE['sel'].'!', 0);
> header('HTTP/1.1 204'); // <- note this...
> exit(); // and this. The me.php is loaded only *ONCE*;
Loaded where? In the browser? This would also be the case with a regular
XHR call - one time the whole document and then only short fragments.
And for the server the load is also the same.
Micha
|
|
|