• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

session.invalidate doubt

 
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
I would like to know why the session.invalidate() doent kill the session completely.

If user click the refresh button he can view the logged out pages also, i.e duplicate form submission.

From where the browser is getting back the data???

where that data is stored??

the data which i am telling is the forwarded data from jsp to servlet, at least the jsp fields data should be destroyed, is there any way to do that??

Thanks and Regards
Adeeb.
 
Ranch Hand
Posts: 331
Python Ruby Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
session.invalidate() clears the server side session.
For the client side (browser) session, you will need to make sure the window gets closed (manually/javascript)
you can solve the problem of duplicate submission by using session objects as tokens that are validated on that event.
Your browser stores its data (fields, etc) in form of cookies and autoloads the session information. Try clearing your cache/ form autoload information to solve that.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi adeeb,

you are asking many question in a single post. and really they are *not* clear to me too.

also Please, UseOneThreadPerQuestion
 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your replies.

In simple words, when i click signout, it is forwarded to logoutservlet, there i have invalidate the session. now when i click back button of browser I get the document expired. That is ok. When i refresh sgain, the page loads. I have gone through the PRG patter, i am unable to implement it, as i am not using any framework. I dint get into my head and trying this since yesterday. . So i was saying that after the page is refreshed i could still see the old data, how come when the session is invalidated? Means this method invalidate is fooling us around?? Some one guide me to a easire way, only one problem and these many



Thanks
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
session.invalidate will clear the data, Its not fooling us. If the browser is showing the page, even after session.invalidate, its most likely to be a browser cache..
 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any way to clear taht cache using servlet. Is it possible???
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have a FAQ entry in JspFaq . NoCacheHeaders . also similar topics discussed many times here. Please Search here for more detail.
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check NoCacheHeaders in the servlets FAQ section here..
 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for quick reply.

But i already added this still the page loads when refreshed..

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

adeeb alexander wrote:
But i already added this still the page loads when refreshed..



Hope you have added them in Jsp. well now did you check the valid session there ? if invalid then did you redirect to login page or some where else?
 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have tried as you said. Check the below code. Is that what you were saying to do, to check the session?? It dint help, any other way out??


IN JSP





SERVLET



Thanks.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

adeeb alexander wrote: Is that what you were saying to do, to check the session??


ohh. noo... I think first you need to thoroughly understand the scope objects in servlet. by the way : you have any idea about javax.servlet.Filter?

<edit>corrected typo</edit>
 
How do they get the deer to cross at the signs? Or to read this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic