Sunday, February 8, 2015

Use of -J onfocus,trailer to fix session expiry issues with java applets

For some of the applet based java applications, there will be a problem with session expiry all of a sudden
when user navigates from one page to other or different tab in the same application..
This is because the session cookie is set inside a java script and there could be also embedded redirects that endsthe session and forc the user to login again inside the new/same window. You would see an error similar to this in the browser.






To fix this issue we need  to add -J onfocus,trailer while creating junction. This enables redirects to be parsed better inside the javascript.

This command controls the JavaScript block that sets a junction identification cookie.

Command Syntax:   junction-cookie-js-block { none | trailer | inhead | onfocus | xhtml10 }

Parameters if

1) none
    Disables the function. This setting is the default value.
2) trailer
    Appends the JavaScript block to the HTML page that is returned from the junctioned server.
3) inhead
    Inserts the JavaScript block between <head></head> tags for HTML 4.01 compliance.
4) onfocus
    Uses the onfocus event handler in the JavaScript to ensure that the correct junction cookie is used in a multiple-junction or multiple-browser-window scenario.
5) xhtml10
    Inserts a JavaScript block that is HTML 4.01 and XHTML 1.0 compliant.

The junction-cookie-js-block command controls the JavaScript block that sets a junction identification cookie. This command is relevant only when the type set by the junction-type command is standard.

For more details please refer the following tech note:
https://www.ibm.com/support/knowledgecenter/en/SSPREK_6.1.0/com.ibm.itame.doc_6.1/am61_webseal_admin585.htm