Invalidating session in servlet
:) Thanks Hi, u can add one char field in ur rdbms, where u can save the state of the user, like, if user logs in, save Y, if user logs off save N.So that, instead of invalidating the session(as of methods r not available), u can check it thr' rdbms. to kulsmadya if you do as what you have said, the requirement of vi fails.Hi, My application controls user login, such that when one client logs in, the application will check if there is an existing similar client (of the same username and password) that has logged in elsewhere.If there is an existing client that logs in earlier, the application has to invaliate that session, before letting this new client log in.Hope sun comes up with something to serve this need. What I need is to invalidate another client's session from my own session, maybe through get Session(id) and invalidate that session like what vraghav mentioned.I also understand these methods are deprecated, so I am looking for more updated methods that I can use.
There is no way for the server to know when the browser closes.
But here, old session will continue & new session wont be created... It was responsible for setting up the environment for the web app.
One of its task is to creates a Hashtable and put it in the Servlet Context object.
This allows me to allow access to web pages only to valid user. I am thinking that the only solution now is to properly validate when the user logs on and then properly invalidate when the user logs out or leaves the ...
I just went thru this same problem building a who's on type program.