Added session functionality to log in and log out