Refactor controller to use session variables to track user's file through the site.