protected String ensurePadding(String base64) {
        int length = base64.length();
        if (length % 4 != 0) {
            StringBuilder sb = new StringBuilder(base64);
            while (sb.length() % 4 != 0) {
                sb.append('=');
            }
            base64 = sb.toString();
        }
        return base64;
    }
Sometimes a user agent will send the rememberMe cookie value without padding,
most likely because {@code =} is a separator in the cookie header.
<p/>
Contributed by Luis Arias.  Thanks Luis!

@param base64 the base64 encoded String that may need to be padded
@return the base64 String padded if necessary.
web/src/main/java/org/apache/shiro/web/mgt/CookieRememberMeManager.java