Customizing the Session ID

The necessary steps depend on whether you are using Natural under UNIX or another scenario.

Start of instruction setTo customize the session ID when running under Natural UNIX

  1. Create new Java file under WEB-INF/contexts - we called it "aaa" in this example.

  2. Implement the Java class in this manner:

    package contexts; 
    
    import com.sabratec.applinx.j2ee.framework.web.GXHostLoginContext; 
    import com.sabratec.applinx.framework.*; 
    
    public class aaa extends GXHostLoginContext { 
    
    private static final long serialVersionUID = 1L; 
    
    public void gx_onLoad() { 
           super.gx_onLoad(); 
    } 
    public void doLogin() { 
           super.doLogin(); 
    } 
    
    @Override 
    public void gx_initSessionConfig() { 
           GXWebAppConfig gx_appConfig = getGXAppConfig(); 
           gx_appConfig.getSessionConfig().setSessionId(getTagsAccesor().getTagContent("GXUser")); 
           gx_appConfig.getSessionConfig().setDescription("desc1"); 
           super.gx_initSessionConfig(); 
    
    } 
    
  3. Edit the hostLogin.jsp to use this new Java file, by pointing the gx_page to the new class <gx:page gx_context="contexts.aaa">.

  4. Use the build script (make.sh) to recompile this class.

  5. Restart Tomcat and try again.

Start of instruction setTo customize the ApplinX session ID in another (non-Natural/UNIX) scenario

  1. Go to the ApplinX web application folder.

  2. Edit the GXBasicContext.java file.

  3. In the gx_initSessionConfig method, uncomment the following line:

    gx_appConfig.getSessionConfig().setSessionId("<YOUR_SESSION_ID>"); 
    
  4. Change <YOUR_SESSION_ID> to the required value.

  5. Use the build script (make.sh etc) to recompile this class.