Getting it to work in browser, fixing login/logout bugs