wood burning stoves 2.0*
The moose likes Servlets and the fly likes session invalidate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "session invalidate" Watch "session invalidate" New topic
Author

session invalidate

Amol Dongre
Greenhorn

Joined: Sep 17, 2010
Posts: 11
when invalidate is called on HttpSession object what happens to session will it become null?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

What happened when you tried it?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Amol Dongre
Greenhorn

Joined: Sep 17, 2010
Posts: 11
when i called method on session for ex. getAttribute() it throws IllegalStateException so if session is null it should throw nullpointerException
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Illegal state exception occurs when the session has been invalidated/expired, and you try to access it.

Throws IllegalStateException - if Object getAttribute(String name) is called on an invalidated session

HttpSession-getAttribute()


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

Which answers the question "does it become null"? Doesn't it?

In fact, if you think about it, how could it become null? Do you think that something is going to reach into your code and change variable values out of the blue?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: session invalidate
 
Similar Threads
How to invalidate session on the basis of session ID in servlet
How to delete a session by knowing the session id
Calling invalidate() on the session....
Ending a session?
Authentication with JDBCRealm - getUser() ?