<div dir="ltr"><div>Hi,<br><br>I think this might be fixed in master, at least this commit <a href="https://github.com/wildfly/wildfly/commit/fe642cd253dc91febed2f763a48853aa200a1bd5">https://github.com/wildfly/wildfly/commit/fe642cd253dc91febed2f763a48853aa200a1bd5</a><br>
was changing this exact behavior.<br><br>can you try with wildfly master if it is still the same?<br><br>--<br></div>tomaz<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 23, 2014 at 3:16 PM, arjan tijms <span dir="ltr">&lt;<a href="mailto:arjan.tijms@gmail.com" target="_blank">arjan.tijms@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi,<br><br></div>For a root deployment, Undertow by default writes the JSESSIONID cookie with an empty path. I.e. in the response header the following appears:<br>
<br></div>SET-COOKIE: JSESSIONID=FhgSh... path=; ...<br>
<br></div>An empty path causes browsers to set the cookie on whatever path was used for the request URI. In effect, this causes multiple JSESSIONIDs to be created while browsing through an app deployed to WildFly, and thus multiple JSESSIONIDs being posted back when other paths are accessed (leading to many issues).<br>

<br></div>The cause of this seems to be in io.undertow.servlet.spec.ServletContextImpl#ServletContextImpl and io.undertow.servlet.core.DeploymentManagerImpl#handleDeploymentSessionConfig, where the cookie path is set to deploymentInfo#getContextPath, which in both cases returns the empty string.<br>

<div><br></div><div>See:<br></div><div><div><div><div><br>io.undertow.servlet.spec.ServletContextImpl.ServletContextImpl(ServletContainer, Deployment)<br><br>sessionCookieConfig = new SessionCookieConfigImpl(this);<br>sessionCookieConfig.setPath(deploymentInfo.getContextPath());<br>

<br></div><div>and:<br></div><div><br>io.undertow.servlet.core.DeploymentManagerImpl.handleDeploymentSessionConfig(DeploymentInfo, ServletContextImpl)<br>if(sc.getPath() != null) {<br>    sessionCookieConfig.setPath(sc.getPath());<br>

} else {<br>    sessionCookieConfig.setPath(deploymentInfo.getContextPath());<br>}<br><br></div><div>I&#39;m not sure if deploymentInfo#getContextPath should indeed return the empty string for a root deployment or not, but I think setting the cookie path to the empty string is not really correct and should be &quot;/&quot; in that case.<br>

<br></div><div>Kind regards,<br>Arjan Tijms<br></div><div><br><br></div><div><br><br></div></div></div></div></div>
<br>_______________________________________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br></blockquote></div><br></div>