Set session time and aux functions to handle sessions.