added login with cookies