Fix way of getting the cookie