public String encodeRedirectURL(String url) {
        if (isEncodeable(toAbsolute(url))) {
            return toEncoded(url, request.getSession().getId());
        } else {
            return url;
        }
    }
Encode the session identifier associated with this response
into the specified redirect URL, if necessary.

@param url URL to be encoded
web/src/main/java/org/apache/shiro/web/servlet/ShiroHttpServletResponse.java