Changed code to conform to new user cookie API.