Preventing Session Timeout
The parent application and its embedded Logi reports may be hosted on
separate web servers and, if so, there will be independent session state
maintained for them on each host. Session expiration on either host may
cause problems. The Embedded Reports API provides functionality for
preventing session timeout for parent and embedded reports.
To use it, create a minimum web page (.htm, .html, .aspx, etc.) that has
no visual elements in the parent application and use the following method
to "ping" it (request the page) at specified intervals.
keepSessionsAlive(pingParentPageUrl, interval)
Pings the parent and embedded applications at the defined interval (in
milliseconds). The default interval is 60000 (1 minute).
- function CreateMyEmbeddedApp() {
- var options = {
- applicationUrl : "https://myAppServer/myLogiAppToEmbed",
- report : "Default",
- autoSizing : "height"
- };
- var report = EmbeddedReporting.create("divEmbedDiv", options);
- EmbeddedReporting.keepSessionsAlive("https://myParentApp/keepAlive.htm", 60000);
- }
The .keepSessionsAlive method call must be placed after the
.create method call in your code.
The method pings the page in the parent application and also automatically determines the URL of the embedded Logi application and pings a standard page that's supplied with the Logi Info product (so you don't have to create a page to ping in the embedded application).
If you have both the parent and the embedded application on the same server, be sure that you specify the same domain for them. For example, do not use https://localhost/myApp to embed the application and then https://127.0.0.1/myParentApp for the keepSessionsAlive method.
This technique only works with a single embedded Logi application; if you have reports from multiple Logi applications embedded in the same parent application, this method will not ping all the Logi applications.
Comments
0 comments
Please sign in to leave a comment.