I want to get the content from http://ipinfo.io/127.0.0.1/country
and store it into a cookie named, country
with the expiry of 24 hours.
I've used PHP and did this several times but have no idea about JQuery. I've used following snippets in PHP
$county=file_get_contents("http://ipinfo.io/127.0.0.1/country");
setcookie("country", $country, time() + (86400 * 30), "/");