# Problem logging out from RESTful authentication

**URL:** <https://www.ruby-forum.com/t/problem-logging-out-from-restful-authentication/156596>\
**Category:** Rails\
**Created:** [December 30, 2008, 5:44pm UTC](https://www.ruby-forum.com/t/problem-logging-out-from-restful-authentication/156596 "2008-12-30T17:44:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldbug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Post date:** [December 30, 2008, 5:44pm UTC](https://www.ruby-forum.com/t/problem-logging-out-from-restful-authentication/156596/1 "2008-12-30T17:44:54Z")

</div>

I just plugged RESTful authentication into my application (following the  
outline given in Ryan Bate’s railscast). As I was doing so, I was  
reading  
through the code. (I know, what a concept! :-)) I noticed that the  
AuthenticatedSystem#access\_denied method redirects to  
#request\_http\_basic\_authentication for anything other than .html  
requests.  
Being a naturally curious kind of fellow, I logged out of my application  
and  
plugged in [http://localhost:3000/documents.xml](http://localhost:3000/documents.xml) to see what would happen.  
Sure enough, the standard web login/password screen popped up on my  
browser  
(Firefox 3.0.5). After providing my username and password, I got to see  
an  
XML representation of my data. So then I when I went back to  
[http://localhost:3000/documents](http://localhost:3000/documents), I was able to see the documents in my  
database, having used HTTP authentication to log in.

Well, that was kinda cool… I guess.

Then I tried to log out.

And I tried again.

I could no longer log out of my application. Nothing I tried worked. I  
tried shutting down and restarting the server (Mongrel). I tried  
changing  
the session secret key (restarting the server). I tried deleting the  
cookie  
from Firefox. I tried deleting all cookies from Firefox.

Finally, I exited Firefox, restarted the server, restarted Firefox, and  
got  
back to my “not logged in” screen.

Just in case there are other “naturally curious kinds of people” out  
there,  
with more time on their hands than is really good for them, I thought I  
would write this down, send it out, and see what folks say.

What do folks say?

–wpd
