Authored by yyq

Merge remote-tracking branch 'origin/feature/cookie' into release/0606

... ... @@ -23,21 +23,14 @@ let _ChannelVary = {
require('./common/share');
function cookie(name) {
let cookies = document.cookie,
cookieVal;
var re = new RegExp(name + '=([^;$]*)', 'i'),
matchPattern = '$1';
if (cookies) {
cookies = cookies.split(';');
for (let i = 0; i < cookies.length; i++) {
if (cookies[i].indexOf(name) > -1) {
cookieVal = decodeURIComponent($.trim(cookies[i].replace(name + '=', '')));
break;
}
}
try {
return re.test(decodeURIComponent(document.cookie)) ? RegExp[matchPattern] : '';
} catch (e) {
return decodeURIComponent(re.test(document.cookie) ? RegExp[matchPattern] : '');
}
return cookieVal;
}
function setCookie(name, value, options) {
... ...