[javatechnicals] How to expire the seesion on browser close

5 views
Skip to first unread message

Sandeep Sontakke

unread,
May 17, 2010, 4:14:47 AM5/17/10
to javatec...@googlegroups.com
Hi All,
 
Does anybody has the solution for following problem..?
In Mozilla there is option we can save and quit the window. In this case
browser caches that perticular page. And on next time browser opens
that page with the same session.
So is there any way to clear the cache on close event of browser?
 
 
Regards,
Sandeep
On Thu, Apr 22, 2010 at 6:44 AM, srinivas <nightwo...@gmail.com> wrote:
I did write proper command
Please ignore the first reply.
These setting we give to JBoss to resolve java.lang.OutOfMemoryError:
PermGen space

set JAVA_OPTS=-Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m
-XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:
+CMSClassUnloadingEnabled

Please note the OutOfMemory does not comes for small application i am
speaking about big enterprise applications having EJB and alot of java
objects.

Shree hari you can ask your friend Gamini the DMS application was
always throwing these Error.
They suggest to increase RAM. You cannot convince client usually to
put more RAM. He might say other applications are running.
Hence give it a try with these startup options.

kalpit shukla

unread,
May 17, 2010, 1:39:53 PM5/17/10
to javatec...@googlegroups.com
Use Event Handler unLoad() and check the X and Y co-ordinates of Mouse (window.event.clientX and window.event.clientY) . If it is less than 0, Firefox is closing so remove the session variables.

Other way

<script language='javascript'>
function onUnloadAction(){
var flag=window.confirm(" Do you want to close ?");
if(flag) {
alert("closing browser");
}
else {
 
}

}
window.onbeforeunload = function(){
if( (window.event.clientX<0) || (window.event.clientY<0) )
{
onUnloadAction();
}

</script>

Srinivas V

unread,
Jun 24, 2010, 12:16:07 PM6/24/10
to javatec...@googlegroups.com
Dear Sandeep,

If you want to close the session in Mozilla Firefox.
Use Add-on "docked js-console". Console of Javascript if error or warning is there it will highlight.

The reason is window.parent and window.child relation breaks and becomes null.
Simply write window.open one jsp like killsession.jsp
and after invalidate the session in killsession.jsp close window.parent and then self.close.

I did this in our application. and it runs in all browsers.

Regards,
Srinivas
Reply all
Reply to author
Forward
0 new messages