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.
3 comments:
Dude, in this example the JS function is for just closing the window right? how will it kill the session?
Sakthi. S
okay got it.. you mean in the application specific action(s), we have to do that.. am I right?
Sakthi.S
Yes, You got it.
Post a Comment