2008/2/25, Albert Ng <[EMAIL PROTECTED]>:
> I'll keep that in mind.
>
> As an aside, using this gem, how would I go about changing the user without
> closing the browser or raising «Unauthorized»?  That last pops up a log-in
> window that can't authorize (have to press escape).

There is no perfect solution. Here is what I use in jQuery :

// idea from : http://nanodocumet.homedns.org/rest/
  $('#header A.disconnect').click(function() {
    try {
      if ($.browser.msie) {
        // IE clear HTTP Authentication
        document.execCommand("ClearAuthenticationCache");
      } else {
        var xhr = new XMLHttpRequest();
        xhr.open("GET", "/logout", true, "logout", "logout");
        xhr.send(null);
        xhr.abort();
      }
    } catch(e) { error(e) }
  })


---------

* the /logout url should respond "Unauthorized" for the logout:logout credential
* the xhr.open is called with async to true, otherwise the browser
shows the login window

-- 
Cheers,
  Jonas
_______________________________________________
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Reply via email to