Loading ...
Sorry, an error occurred while loading the content.

are cookies EVER restful?

Expand Messages
  • pkeane
    It seems to me like cookies are are regarded as something to be avoided (and undoubtedly they are usually misused), but aren t there RESTful uses of cookies
    Message 1 of 99 , Dec 1, 2007
    • 0 Attachment
      It seems to me like cookies are are regarded as something to be avoided
      (and undoubtedly they are usually misused), but aren't there RESTful uses
      of cookies that could/should be encouraged (i.e., built into frameworks,
      etc)?

      Per Ruby/Richardson (p.253):
      "The server can suggest values for a cookie using Set-Cookie header, just
      like it can suggest links the client might want to follow...[snip]. The
      cookie is just a convenient container for application state, which makes
      it's way to server in representations and URIs. That's a very RESTful use
      of cookies."

      Does it follow that personalization can BEST be achieved by having a
      cookie that contains the user's id sit on the browser and used to
      construct URLs for XMLHTTPRequests (e.g.,
      http://example.com/userdata/{user-id}) that will return data to be
      inserted into the page?

      Note that I do not want the user-id to be included in the url for the page
      itself (e.g. http://example.com/home). I am assuming that the login
      process, which can use HTTP Auth, will give the server the opportunity to
      set the cookie at the start of the login 'session'.

      thoughts?

      -Peter Keane
    • Mike Schinkel
      Alexander Johannesen wrote ... *Techinically* you are correct and thus my comments could be construed as being misleading, but I ll still argue my premise that
      Message 99 of 99 , Jan 5, 2008
      • 0 Attachment
        Alexander Johannesen wrote
        > Unless you have some special meaning with "broad", PHP4
        > indeed has good support for XML. In all my years my XML
        > parsers have never found an ISP or server where this was a problem.

        *Techinically* you are correct and thus my comments could be construed as
        being misleading, but I'll still argue my premise that the XML support in
        PHP4 is not all that usable or productive by quoting an article about PHP5's

        XML support compared to the XML support of PHP 4:

        FROM: http://www.devshed.com/c/a/PHP/Whats-New-in-PHP-5/

        "PHP 5 by default installs XML support and offers a new extension,
        SimpleXML. ... The XML functionality that has been available through PHP in
        the past has been quite rudimentary and required a fair amount of
        programming work to use, so it is not uncommon to see PHP 4 applications
        using XML without ever touching the xml functions.... PHP 5 also offers a
        replacement extension for DOMXL (available in "experimental" form in PHP 4)
        with the DOM extension. ... Both of the extensions are robust and well
        thought out, and whichever suits your programming needs and taste, you will
        be using a powerful extension that is light years beyond what was available
        in PHP 4."

        FWIW, YMMV.

        --
        -Mike Schinkel
        http://www.mikeschinkel.com/blogs/
        http://www.welldesignedurls.org
        http://atlanta-web.org
      Your message has been successfully submitted and would be delivered to recipients shortly.