Refactored all code completely out of SessionsHelper and into ApplicationHelper and ApplicationController depending on whether the code is used only in controllers or in both controllers and views throughout the application.