class Cookie {
	public constructor() {
	}
	static setCookie(name, value) {
		var Days = 7;
		var exp = new Date();
		exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
		exp.setTime(exp.getTime() + 60 * 1000);
		if (location.port == '8080') {
			document.cookie = name + "=" + decodeURI(value) + ";expires=" + exp.toUTCString();
		} else {
			document.cookie = name + "=" + decodeURI(value) + ";domain=.eosget.io;path=/;expires=" + exp.toUTCString();
		}
	}
	static getCookie(name) {
		var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)")
		if (arr = document.cookie.match(reg)) {
			return encodeURI(arr[2]);
		} else {
			return null
		}
	}
	static delCookie(name) {
		var str = name + "=;domain=.eosget.io;path=/";
		var expires = (new Date(0)).toUTCString();
		str += ";expires=" + expires;
		document.cookie = str;

		var str = name + "=;path=/";
		var expires = (new Date(0)).toUTCString();
		str += ";expires=" + expires;
		document.cookie = str;
	}
}