Distributed sessions for multiple web-apps in a single App. Server (v.8.1)
I have 3 applications on App. Server 8.1 (running on JDK 1.5)
App-A handles login
App-B and App-C are functions that are accessible after login is validated.
It works fine with App. Server 6.5 (JDK 1.3)
But the distributed session cannot be shared in App. Server 8.1 (JDK 1.5)
So App-A handles sign on and stores the user's Login Name on the session.
App-B and App-C read the user's login name from the session object and grant access to different modules.
1. Starting App-A and perform login
2. Starting App-B from App-A (it is linked there)
3. Starting App-C from App-A (it is linked there)
In step 1, a new session is created for the user, an attribute ("LoginName") is put in the session - ie. using HttpSession.setAttribute()
In step 2, the program checks for attribute "LoginName" from the session object - ie. using HttpSession.getAttribute()
If not found, redirect to login; if found, then continue with App-B
In step 3, same as in step 2 above.
It works fine with App. Server 6.5 but problem occurs in step 2 and 3.
web.xml of App-A, App-B and App-C:
<i>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>App-A</display-name>
<distributable/>
</i>
sun-web.xml of App-A, App-B and App-C
<i>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">
<sun-web-app>
<session-config>
<session-manager persistence-type="memory">
<manager-properties>
<property name="persistenceFrequency" value="web-method"/>
</manager-properties>
<store-properties>
<property name="persistenceScope" value="session"/>
</store-properties>
</session-manager>
</session-config>
</i>

