HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › Troubleshooting › Session not transfered when using pd4ml.render() › Re: Re: Session not transfered when using pd4ml.render()
The session ID propagation of a particular web application depends on the platform and configuration of server or the application.
In J2EE/Servlet/JSP “world” it uses JSESSIONID cookie or jsessionid URL suffix, however it is possible to override the defaults. Also the configuration may disable the cookie method or the URL suffix method.
PD4ML supports the following methods of session ID propagation.
Let’s say we load http://pd4ml.com
- pd4ml.setCookie( “JSESSIONID”, cookieValue );
where cookieValue is something like that: “9034657927465;path=/”
The cookie is sent with the “main” request to http://pd4ml.com as well as with the requests to the referenced resources (images, CSSs etc)
- pd4ml.setSessionID( sessionID )
In the case PD4ML embeds the sessionID only to referenced resource URLs this way:
http://pd4ml.com/i/logo.gif;jsessionid=9034657927465?other=params&if=any
If it fails with the embedded jsessionid, it repeats the request without the ID.
NOTE: It does not embed jsessionid to the original request to http://pd4ml.com, as you have control over the URL string in your Java code, so you can ebbed it by yourself and avoid possible confusions with the request repeating.
You may see the modified image URLs on STDOUT or in the server log if you switch the debug mode on:
pd4ml.enableDebugInfo();
The default “jsessionid” keyword can be changed with
-Dpd4ml.sessionid.varname=othername
JVM command line parameter.