Get and set user as JS global var