Hi friends i have set an attribute in jsp and if i close the browser and again open the browser and try to view the same jsp .That session attribute still persist.Can any one suggest me the way to destroy the attribute on closing window.
Hmm. I just tried your code and it's not doing that on my machine. After closing the browser, I see "First Timer". What browser are you using?
Are you sure that you're really closing it? What I mean when I ask this, is, do you have any browser windows left open? I know that, with Firefox, if I have a separate window (console debugger, LiveHeaders, download manager, etc..) open, if I close the main Firefox window but not the others, Firefox is still running and maintaining its sessions. I just tried this and after re-opening Firefox, "Second Timer" came up. When I shut ALL the Firefox windows and re-opened it, "First Timer" was the first message to come up. [ February 15, 2008: Message edited by: Ben Souther ]
Joined: Feb 22, 2007
Hi Ben Thanks for your analysis.Yes i am using Firefox and there were many other windows open.I think this was the problem.I got it.But let me tell you what i am trying to achieve,may be you have some better idea. I want to develop one monitor jsp which will show the web crawling status.Jsp will contain one button 'crawl'. if i click that, a java class's crawl method will be called which will crawl website.This page will automatically refresh itself to get the status from crawl class.I don't want that crawl method to execute on every refresh.I will call method invocation in 'if' condition and monitor logic in 'else' part.Is there any other way than using session?