remove jsessionid in url
-
26-10-2019 - |
Question
I am facing a problem in jsf web application deployed in jetty web-server. When access application in browser, jsessionID is appended in the url. I want to remove it from there. Thanks in advance.
Solution
Set the org.mortbay.jetty.servlet.SessionURL
parameter to none
in either the application web.xml or the context configuration.
See the Jetty jsessionId documentation.
OTHER TIPS
You can do that by Setting Session Characteristics. Set the context parameter org.eclipse.jetty.servlet.SessionIdPathParameterName
to none
to disable url rewriting and prevent the jsession id appended to URL.
In web.xml,
<context-param>
<param-name>org.eclipse.jetty.servlet.SessionIdPathParameterName</param-name>
<param-value>none</param-value>
</context-param>
Or if you are using annotation config instead of web.xml,
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
servletContext.setInitParameter("org.eclipse.jetty.servlet.SessionIdPathParameterName", "none");
}
Refer: Jetty's Session Management
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow