[Fixes #6] add login/logout function