title: Weblogic url-rewriting true only if cookies are off
body: <p>I want to have an application deployed on a weblogic container that uses url rewriting only if cookies are disabled in the browser.</p>
  
  <p>I need this because even if the browser has cookie enabled, on the first request url-rewritting is used. So the url looks something like</p>
  
  <blockquote>
    <p><code>mysite.com/go;jsessionid=YZLVTW3P1fPdLFc28BxgN72zhmXNGMpkYpwnTflDGJy9Gvp7R61n!-128874051</code></p>
  </blockquote>
  
  <p>And I wold like it to be </p>
  
  <blockquote>
    <p><code>mysite.com/go</code></p>
  </blockquote>
  
  <p>if cookies are enabled and append the jsessionid only if cookies are disabled.</p>
  
  <p>I have now the following configuration in weblogic.xml</p>
  
  <pre><code>&lt;session-descriptor&gt;
          &lt;debug-enabled&gt;true&lt;/debug-enabled&gt;
          &lt;persistent-store-type&gt;replicated_if_clustered&lt;/persistent-store-type&gt;
          &lt;url-rewriting-enabled&gt;true&lt;/url-rewriting-enabled&gt;
          &lt;cookies-enabled&gt;true&lt;/cookies-enabled&gt;
          &lt;cookie-secure&gt;true&lt;/cookie-secure&gt;
  &lt;/session-descriptor&gt;
  </code></pre>
  
  <p>Does any one know if it is possible to enable </p>
  
  <pre><code>&lt;url-rewriting-enabled&gt;true&lt;/url-rewriting-enabled&gt;
  </code></pre>
  
  <p>only if cookies are disabled?</p>
  
  <p>How would you do something like this? Java code filter?</p>
  
  <p>More details: 
  what I need is to have behaviour that is like this</p>
  
  <pre><code>&lt;session-descriptor&gt;        
          &lt;url-rewriting-enabled&gt;true&lt;/url-rewriting-enabled&gt;
          &lt;cookies-enabled&gt;false&lt;/cookies-enabled&gt;
      &lt;/session-descriptor&gt; 
  </code></pre>
  
  <p>and </p>
  
  <pre><code>&lt;session-descriptor&gt;        
          &lt;url-rewriting-enabled&gt;false&lt;/url-rewriting-enabled&gt;
          &lt;cookies-enabled&gt;true&lt;/cookies-enabled&gt;
      &lt;/session-descriptor&gt;
  </code></pre>
  
  <p>Or something that mimics this (even java filter would be good), url-rewriting-enabled only if cookies are disabled. As I said on the first request I do get the jsessionid even though cookies are enabled.</p>