Handle login with Tomcat correctly fixes #7

thanks @katanafleet