remove unnecessary session_name(). 
add session_regenerate_id() to login() for preventing session fixation
attacks. 
add destroying of $_SESSION to logout().