class Cookie {
	static set(name,value,expiry) {
		let expires = expiry ? "; expires="+expiry.toGMTString() : "";
		document.cookie = name+"="+value+expires+"; path=/";
	}

	static get(name) {
		let nameEQ = name + "=";
		let ca = document.cookie.split(';');
		for(let i=0;i < ca.length;i++) {
			let c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}

	static erase(name) {
		Cookie.set(name,"",new Date());
	}
};