function WriteSessionCookie(cookieName, cookieValue, cookiePath) {
	document.cookie = cookieName + "=" + cookieValue + "; ; path=" + cookiePath + ";";
	}

function GetCookieValue(cookieName) {
	var completeCookieTray = document.cookie + ";"; //I append a semicolon because by default document.cookie does not end with a semicolon, which makes it harder to find the last cookie value.
	var cookieStartIndex = completeCookieTray.indexOf(cookieName + "=");
	if (cookieStartIndex == -1) { //If there's no such cookie...
		//alert("Failed to find cookie " + cookieName);
		return "NoSuchCookie";
		}
	else {
		var cookieValue = completeCookieTray.substring(completeCookieTray.indexOf('=', cookieStartIndex) + 1,completeCookieTray.indexOf(';', cookieStartIndex));
		return cookieValue;
		}
	}

function TestSessionCookies() {
	WriteSessionCookie("spikeTestCookie", "test", "/");
	if (GetCookieValue("spikeTestCookie") == "test") {
		return true;
		}
	else {
		return false;
		}
	}
