Session Id in cluster

Posted on 2004-11-08
Last Modified: 2013-12-10

I have made a cluster of two servers in weblogic 8.1.3. I want to have a same session id to be maintained for these servers. Please let me know how can I do that.
Question by:rajneetbhatia
    LVL 8

    Expert Comment

    you can check out this for setting up your cluster for sharing the session information
    LVL 5

    Accepted Solution

    Create a J2EE standard web application (w/ the WEB-INF folder and web.xml).  Add a weblogic.xml file to the web application, and, for in-memory replication of session state, add format your weblogic.xml file like this:

    <!DOCTYPE weblogic-web-app PUBLIC    "-//BEA Systems, Inc.//DTD Web Application 8.1//EN"    "">


    Also remember you have to access the weblogic cluser via a proxy, like IIS or Apache, or Weblogic's proxy servlet.  The proxy is able to detect whether or not one of the servers in the cluster is down, and if so, change requests over to the other server.

    Be sure to deploy your web application to the cluster, and not to individual servers

    Author Comment


    I am able to have same session id for servers in a cluster. I will work further on it and if I need any help, I will contact again.

    R S

    Author Comment

    Respected Sir/Madam,

    I am able to maintain the same session id in a cluster for all servers, but now I have a problem with application object. Please let me know how can I have a same application level properties for servers in a cluster.

    R S
    LVL 5

    Expert Comment

    When you say application-level properties are you referring to a web application deployed against a cluster?

    For static application-level variables you could store them in a properties file under WEB-INF\classes.  All Servlets and JSPs will be able to access them.  Load them into a Properties object using:  


    For dynamic variables, use application.setAttribute() and application.getAttribute() in JSPs (just like session or request's setAttribute()/getAttribute() methods).  The application variable in a JSP is an instance of ServletContext (which you can get from within a servlet as well).    The attributes you set dynamically using the application object will live as long as the cluster is running, and can be accessed by any web application in the cluster.

    If you're using Weblogic Workshop, place application-level variables in globalApp.  They will be accessible from all servlets, JSPs, Java Controls, and web services in the web application.

    You probably want to open a new topic on this if you need more in-depth assistance.


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
    A quick step-by-step overview of installing and configuring Carbonite Server Backup.
    This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…
    This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now