Revise getLocalCookie

http://www.w3schools.com/js/js_cookies.asp