MCPcopy Index your code
hub / github.com/apache/tomcat / stripSession

Method stripSession

java/org/apache/jasper/tagplugins/jstl/Util.java:174–188  ·  view source on GitHub ↗

Strips a servlet session ID from url . The session ID is encoded as a URL "path parameter" beginning with "jsessionid=". We thus remove anything we find between ";jsessionid=" (inclusive) and either EOS or a subsequent ';' (exclusive). taken from org.apache.taglibs.standard.tag.common.

(String url)

Source from the content-addressed store, hash-verified

172 * @return the URL without a user submitted session id parameter
173 */
174 public static String stripSession(String url) {
175 StringBuilder u = new StringBuilder(url);
176 int sessionStart;
177 while ((sessionStart = u.toString().indexOf(";" + "jsessionid" /* FIXME */ + "=")) != -1) {
178 int sessionEnd = u.toString().indexOf(';', sessionStart + 1);
179 if (sessionEnd == -1) {
180 sessionEnd = u.toString().indexOf('?', sessionStart + 1);
181 }
182 if (sessionEnd == -1) {
183 sessionEnd = u.length();
184 }
185 u.delete(sessionStart, sessionEnd);
186 }
187 return u.toString();
188 }
189
190 /**
191 * Performs the following substring replacements (to facilitate output to XML/HTML pages):

Callers

nothing calls this directly

Calls 4

lengthMethod · 0.80
toStringMethod · 0.65
deleteMethod · 0.65
indexOfMethod · 0.45

Tested by

no test coverage detected