Invalidating a session in

09-Oct-2015 18:19

Hi All, I want to invalidate user's session when user log in from different remote location in web application.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.How about people who run both Firefox and Chrome, which are separate applications, on the same computer?What about shared IP connections on separate computers?It centres around the Http Session object, which on the Servlet represents the "session of the client whose request is being processed".To obtain or create a session, we call Sessions per se aren't terribly useful without session attributes.

For example, we can implement a "login request" as follows: in this case), though could actually be any Java object.Any existing binding with the same name is overwritten.For an object bound into the session to be distributed it must implement the serializable interface.where from user login and i can as admin invalidate his/her session.Vymokesha, what Pat is trying to convey is that how would you take care of different scenarios arises from, say, e.g opening two different browser, in that case, do you want to invalidate the session running on one browser and keeping it alive on second ?

For example, we can implement a "login request" as follows: in this case), though could actually be any Java object.

Any existing binding with the same name is overwritten.

For an object bound into the session to be distributed it must implement the serializable interface.

where from user login and i can as admin invalidate his/her session.

Vymokesha, what Pat is trying to convey is that how would you take care of different scenarios arises from, say, e.g opening two different browser, in that case, do you want to invalidate the session running on one browser and keeping it alive on second ?

interface, that it is being bound into or unbound from the session.