add session handling to views