First page Back Continue Last page Image
- /* This function dissects the cookie and extracts the date
- In the form dd Month yyyy, It requires the name of the
- Cookie as an input variable*/
- function cookieVal(cookieName) {
- // Create a new array called thisCookie and load it with the parts of the cookie delimited on ;
- var thisCookie = document.cookie.split("; ");
- // Step through each element of the cookie
- for (var i=0; i<thisCookie.length; i++) {
- // Split each element of the cookie again using = as the delimiter
- if (cookieName == thisCookie[i].split("=")[0]) {
- /* If the first array element is pageVisit return the 2nd array element to
- the calling function as the last visited date*/
- return thisCookie[i].split("=")[1];
- }
- }
- // otherwise return the beginning of computer time as the last visited date
- return "1 January 1970";
- }