Added session timeout function.