Question-The page isn't redirecting properly

I’m running into a problem where Firefox is returning this error page
“The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for
this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to
accept cookies.”

Cookies though are enabled so that is not the problem. Now I’m using
restful_authentication plugin. I have set this in my application.rb
controller file -

include AuthenticatedSystem
before_filter :login_required

The login_required method looks like it should redirect to my login
page:

def login_required
username, passwd = get_auth_data
self.current_user ||= User.authenticate(username, passwd) ||
:false if username && passwd
logged_in? && authorized? ? true : access_denied
end

and here is access_denied
def access_denied
respond_to do |accepts|
accepts.html do
store_location
redirect_to :controller => ‘sessions’, :action => ‘new’
end

So as the code above reflects the redirect is attempting to go to
sessions/new and it does reflect that in the browser url , however
instead of displaying the login page I get the above error. Any ideas
?

TIA
Stuart

Stuart Fellowes wrote:

I’m running into a problem where Firefox is returning this error page
“The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for
this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to
accept cookies.”

Are you skipping the before_filter in :controller => ‘sessions’ ?
If not you’ll get an infinite redirection loop (since loading
sessions/new will also result in access denied being called).

Fred

Thank you Frederick, I put the skip skip_before_filter in the sessions
controller and it’s redirecting correctly. Just seemed that the
access_denied method was set up for that specific reason. I gather
it’s because logged_required is in the application controller.

Stuart

On 9/18/06, Frederick C. [email protected] wrote:

If not you’ll get an infinite redirection loop (since loading
sessions/new will also result in access denied being called).

Fred


Posted via http://www.ruby-forum.com/.