protected String[] decodeCookie(String cookieValue) throws InvalidCookieException {
        int paddingCount = 4 - (cookieValue.length() % 4);
        if (paddingCount < 4) {
            char[] padding = new char[paddingCount];
            Arrays.fill(padding, '=');
            cookieValue += new String(padding);
        }
        String cookieAsPlainText;
        try {
            cookieAsPlainText = new String(Base64.getDecoder().decode(cookieValue.getBytes()));
        } catch (IllegalArgumentException ex) {
            throw new InvalidCookieException(
                "Cookie token was not Base64 encoded; value was '" + cookieValue + "'");
        }
        String[] tokens = StringUtils.delimitedListToStringArray(cookieAsPlainText, DELIMITER);
        for (int i = 0; i < tokens.length; i++) {
            tokens[i] = URLDecoder.decode(tokens[i], StandardCharsets.UTF_8);
        }
        return tokens;
    }
@Test
    void decodeCookieTest() {
        var cookieValue = "YWRtaW46MTcxODk2NDE3NDgwODpTSEE"
            + "tMjU2OmNkOTM0ZTAyZWQ4NGJmMzc1ZTA4MmE1OWU4YTA3NTNiMzA3ODg1MjZmYzA3Yjgy"
            + "YzVmY2Y3YmJiYzdjYzRkNWU";
        // 123 % 4 = 3, so we need to add 1 '=' to make it a multiple of 4 for
        // spring-security/gh-15127
        assertThat(cookieValue.length()).isEqualTo(123);
        var cookie = tokenBasedRememberMeServices.decodeCookie(cookieValue);
        assertThat(cookie).containsExactly("admin", "1718964174808", "SHA-256",
            "cd934e02ed84bf375e082a59e8a0753b30788526fc07b82c5fcf7bbbc7cc4d5e");

        cookieValue = "ZmFrZS11c2VyOjE3MTY0MzUxODczMjM6U0hBLTI1NjoyOWYxYzdjY2JiNDg5NzQxMz"
            + "kyZDI3YmE1YzMwZjMwZDA1Yzc5ZWU2NjI4OWI2ZDZkYTViNDMxYmJhOTlhMGM3";
        assertThat(cookieValue.length()).isEqualTo(128);
        cookie = tokenBasedRememberMeServices.decodeCookie(cookieValue);
        assertThat(cookie).containsExactly("fake-user", "1716435187323", "SHA-256",
            "29f1c7ccbb489741392d27ba5c30f30d05c79ee66289b6d6da5b431bba99a0c7");
    }