I am using the following code to remove a attribute from session
List<User> l=(List<User>) sess.getAttribute("allUserslist");
for(int ii=0;ii<l.size();ii++){
System.out.println("bef"+l.get(ii).getLoginName()+optionSelected[i]);
if(l.get(ii).getLoginName().equals(optionSelected[i])){
System.out.println("in iteration");
sess.removeAttribute(l.get(ii).getLoginName());
List<User> l1=(List<User>) sess.getAttribute("allUserslist");
System.out.println("final size"+l1.size());
}
}
The final size after removing is still one as before, where am I going wrong?