i want to do following thing
when ever any user try to login with different username and password from same browser my system should logged him as first user
eg
suppose i already logged in with username gp
and again try to open second browser window and try to log in with different password then my system should not all second user to logged in from same browser
while searching the net somewhere i have got code it indicates that we have to synchronized the session
i.e.
/**
* This method sets attributes in session
* @param session
* @param attribute
* @param key
*/
public static void setAttributesInSession(HttpSession session, Object attribute,
String key) {
synchronized (session) {
session.setAttribute(key, attribute);
}
}
i have tried above code but it does not work
and
allowing other user to logged in please give me solution