Routing after logging in

Hello: I am using Authlogic in my application. I am using before_filter to restrict access to certain sections of my web application and that is working (i.e. if i am not logged in and try to access those pages - the application gives me the login form to log-in). However, every time I login - it brings me to 'root_url'. How do I define the path so instead of bringing me back to 'root_url' it takes me to the restricted page where I was trying to go in the first page?

Here are the code files:

--create in my user_sessions_controller.rb: class UserSessionsController < ApplicationController

  def create     @user_session = UserSession.new(params[:user_session])     if @user_session.save       flash[:notice] = "Successfully logged in."       redirect_to root_url     else       render :action => 'new'     end   end

end