• Post Reply Bookmark Topic Watch Topic
  • New Topic

The method logout() is undefined for the type HttpSession

 
Javed Ansari
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to invalidate all the sessions by calling HttpSession.logout() in doPost(). I can see this API in a famous servlet book (Coreservlet and Javaserver pages by MartyHall) but in Eclipse it is not able to find out even with the latest JDK 1.7.
 
Sumit Patil
Ranch Hand
Posts: 296
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no such method in HttpSession
 
Sumit Patil
Ranch Hand
Posts: 296
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And Welcome to the Ranch
 
Singh Harmeet
Ranch Hand
Posts: 115
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the login() and logout() method is the servlet 3.0 specification , not the jdk 1.7 specification , and this is not in Httpession , this is ih HttpServletRequest . when we call to the logout() method the session attribute are still in session scope , the session is not invalidate if you want to invalidate session , call to the session invalidate() method.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!