Moving session checks to a helper file.