Cookie Parser

It is simple to add cookie information using JavaScript. Getting it back is not as straightforward. The function below can help out a lot.

Input:
Cookie parameter
Output:
Cookie value
function C$(fldNm) { var oRe = new RegExp("[;\\s]"+fldNm+"=([^;]*)","i"); var fldVal = oRe.exec("; "+document.cookie); return (fldVal) ? unescape(fldVal[1]) : ""; }