how to avoid past pages to be displayed

I've got the following problem with firefox:

When I click the back button after logging out, I can see all the
pages of the browser history where I was logged in. These pages are
not reloaded, so I assume the before_filter is not called. How do
other pages like avoid the browser history being
displayed again?

  # before_filter for all methods that require the user to be logged
  def user_test_logged
    @user = User.find_by_id(session[:user_id])
    if @user.nil?
      redirect_to(:controller => "login" , :action => "login" ) and
return false

  def login
      user = User.authenticate(params[:name], params[:password])
      if user
        session[:user_id] =
        redirect_to :action => 'index' and return false
    render :layout => false

  def logout
    redirect_to :action => 'login'


You are probably in development mode and viewing the browsers cache. In
production mode, this shouldn’t happen, although there really is no way
to completely prevent it. Production mode sends the no-cache header,
but it’s up to the particular browser to decide whether to abide by
that or not.


Luma wrote: