determine in js if user logged in