In my servlet, if I want to remove a specific session attribute I run:
session.removeAttribute("user");
and I want to remove all of them:
session.invalidate();
How to remove only those session attributes which their name starts from a specific value? For example instead running:
session.removeAttribute("userDsdf");
session.removeAttribute("userSDFSF");
session.removeAttribute("userVSDfs");
session.removeAttribute("userESFDFS");
run something like session.removeAttribute("user%");