replace cookies with  vars, update currentUser ref