i've faced a strange problem with weblogic. One of our workstations hosts 2 weblogic instances. The problem is when i log in to one of them, session on another automatically expires and vice versa. What can it be? How to deal with this problem?
If the session id is stored within a cookie on the client side, make sure the cookie name is not the same on both your weblogic instances.
One way to change the cookie name is to create a file named weblogic.xml in your webapps (or weblogic-application.xml in your EARs, just replace the tag weblogic-web-app by weblogic-application) containing the following (customize the cookie name according to your needs):
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90">
<session-descriptor>
<cookie-name>MyCookieName</cookie-name>
</session-descriptor>
</weblogic-web-app>
since they are running on the same machine, your browser sees one host (i.e. localhost). since the default session cookie for java webapps is JSESSIONID and both are using this cookiename they will overwrite each other.
A solution is to open 2 IE browser windows by starting IE twice. In that case they will get their own session cookie. Unfortunalty this doesn't work for Firefox and Chrome.
An other solution is mentioned by nawre, by giving the 2 webapps a different session cookie name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With