fixed geolocation and cookies functions on javascript