implemented user session and logout