Showing posts with label session issue. Show all posts
Showing posts with label session issue. Show all posts

Sunday, February 26, 2012

To read Window’s close button event using java script for application specific processing like session clear etc.


We are in very rapid technology transition world. Writing an application which is comparable to all the browsers and environments will be a tedious task for the developers like me.

Let me write a common & interesting issue with the web application session handling. While developing the web application, we will be clear about the scope of the variable to be used with in a web application (Like application, Session, Request and page scope etc). The entire logged in user specific details usually will be stored as session attributes. If we clear all session attributes, prior to closing the web application, its fine. No Harm. The same can be turned to be a headache if HttpSession was not handled properly. However if you use IE6, browser session automatically collected. In IE7, the same session will be used irrespective of the tabs opened within a browser instance. For IE8, same session will be used for all the browser/tab instances opened in a machine.

In a typical web application, we will be providing a Close/LogOff kind of buttons, so user could follow some basic process to exit the web application, using the button, we can handle the HttpSession. Also, we can’t assume that everyone would follow the process (It’s like turning off the PC. Sometimes we used to press the power button instead of shut down our PC). Now, the question is how can we handle, user session attributes such occasions as well.

Below example is self explanatory to address the above mentioned issue specifically for IE. Write to me if anything unclear.



Pega Decisioning Consultant - Mission Test Quiz & Answers

The Pega Certified Decisioning Consultant (PCDC) certification is for professionals participating in the design and development of a Pega ...