fix cookie util functions in IE8 and older, add String.prototype.trim() polyfill util function