Refactored to use application controller and new current_user method instead of the sessions controller.