• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session Destroy problem.

 
sarojni agrwal
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a problem, in destroy of session.
I made a jsp page.



This is servlet.




another servlet(in this servlet, I used session.invalidate()) to destroy session , but it did not work, when I try to run any program , the browser gives same value. what should I do?






 
Dave Tolls
Ranch Hand
Posts: 2369
25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the flow?
That JSP is only calling "/check1".
I don't see anything calling "/check".

That's the first thing I noticed.

After that, I would suggest sticking in some debug statements to log where you are getting to in the code.
 
Tim Holloway
Bartender
Posts: 18469
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are calling getSession without any parameters. The defauit (no-parameter) implementation of getSession is equivalent to getSession(true). So you're creating a new session.

Which is just as well, since you aren't checking to see if getSession returned null.
 
We can walk to school together. And we can both read this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!