docs: private String addCookieValues(HttpServletRequest request, Map<String,Cookie> newCookies, String url, String encoding) {
  		// Split the anchor
  		int poundPos = url.lastIndexOf('#');
  		String anchor;
  		if(poundPos==-1) anchor = null;
  		else {
  			anchor = url.substring(poundPos);
  			url = url.substring(0, poundPos);
  		}
  		// Don't add for certains file types
  		int questionPos = url.lastIndexOf('?');
  		String lowerPath = (questionPos==-1 ? url : url.substring(0, questionPos)).toLowerCase(Locale.ROOT);
  		if(
  			// Matches SessionResponseWrapper
  			// Matches LocaleFilter
  			!lowerPath.endsWith(".bmp")
  			&& !lowerPath.endsWith(".css")
  			&& !lowerPath.endsWith(".exe")
  			&& !lowerPath.endsWith(".gif")
  			&& !lowerPath.endsWith(".ico")
  			&& !lowerPath.endsWith(".jpeg")
  			&& !lowerPath.endsWith(".jpg")
  			&& !lowerPath.endsWith(".js")
  			&& !lowerPath.endsWith(".png")
  			&& !lowerPath.endsWith(".svg")
  			&& !lowerPath.endsWith(".txt")
  			&& !lowerPath.endsWith(".zip")
  		) {
  			try {
  				Cookie[] oldCookies = null;
  				boolean oldCookiesSet = false;
  				StringBuilder urlSB = new StringBuilder(url);
  				boolean hasParam = questionPos!=-1;
  				for(String cookieName : cookieNames) {
  					if(newCookies.containsKey(cookieName)) {
  						Cookie newCookie = newCookies.get(cookieName);
  						if(newCookie!=null) {
  							if(hasParam) urlSB.append('&');
  							else {
  								urlSB.append('?');
  								hasParam = true;
  							}
  							urlSB
  								.append(URLEncoder.encode(COOKIE_URL_PARAM_PREFIX+cookieName, encoding))
  								.append('=')
  								.append(URLEncoder.encode(newCookie.getValue(), encoding))
  							;
  						} else {
  							// Cookie was removed - do not add to URL
  						}
  					} else {
  						// Add each of the cookie values that were passed-in on the URL, were not removed or added,
  						// and were not included as a request cookie.
  						String paramName = COOKIE_URL_PARAM_PREFIX+cookieName;
  						String[] values = request.getParameterValues(paramName);
  						if(values!=null && values.length>0) {
  							boolean found = false;
  							if(!oldCookiesSet) {
  								oldCookies = request.getCookies();
  								oldCookiesSet = true;
  							}
  							if(oldCookies!=null) {
  								for(Cookie oldCookie : oldCookies) {
  									if(oldCookie.getName().equals(cookieName)) {
  										found = true;
  										break;
  									}
  								}
  							}
  							if(!found) {
  								if(hasParam) urlSB.append('&');
  								else {
  									urlSB.append('?');
  									hasParam = true;
  								}
  								urlSB
  									.append(URLEncoder.encode(paramName, encoding))
  									.append('=')
  									.append(URLEncoder.encode(values[values.length-1], encoding))
  								;
  							}
  						}
  					}
  				}
  				url = urlSB.toString();
  			} catch(UnsupportedEncodingException err) {
  				throw new WrappedException(err);
  			}
  		}
  		if(anchor!=null) url += anchor;
  		return url;
  	}