themis/web/js/lib/aui.js
// Either append or replace the value in the cookie string/
Either append or replace the value in the cookie string
Either append or replace the value in the cookie string
function addOrAppendToValue(name, value, cookieValue) {
      var reg = new RegExp('(\\s|\\|)*\\b' + regexEscape(name) + '=[^|]*[|]*');
      cookieValue = cookieValue || '';
      cookieValue = cookieValue.replace(reg, '|');
      if (value !== '') {
          var pair = name + '=' + value;
          if (cookieValue.length + pair.length < 4020) {
              cookieValue += '|' + pair;
          }
      }
      return cookieValue.replace(CONSECUTIVE_PIPE_CHARS_REGEX, '|');
  }
function addOrAppendToValue ( name , value , cookieValue ) { var reg = new RegExp ( '(\\s|\\|)*\\b' + regexEscape ( name ) + '=[^|]*[|]*' ) ; cookieValue = cookieValue || '' ; cookieValue = cookieValue . replace ( reg , '|' ) ; if ( value !== '' ) { var pair = name + '=' + value ; if ( cookieValue . length + pair . length < 4020 ) { cookieValue += '|' + pair ; } } return cookieValue . replace ( CONSECUTIVE_PIPE_CHARS_REGEX , '|' ) ; }
Either append or replace the value in the cookie string
Either append or replace the value in the cookie string
// A cookie name follows after any amount of white space mixed with any amount of '|' characters. // A cookie value is preceded by '=', then anything except for '|'.