Invalidating session in java


27-May-2020 11:02

I have session ID and user name of particular user so when i try to use like this Http Session Context context=Session()Session Context(); Session(session ID).invalidate(); this is giving null pointer.

and according to sun this method is depreciated for security reason.

And we are using Quartz schedualr which will calls a class which is implementing Job. Using this I want to invalidate all the active sessions.

I have idea like by using Http Session Listener we can do.

4) What about shared IP connections on separate computers?

so kindly is there any alternative way we have many thing like remote ip address, Session Listner, Context Listner etc. The best method to invalidate session or not allowing a user to have more than one session, is to create the context scoped map and store the session id and all the relevant info of user into the map.