Second Draft - add session timeout function