1) Settin' the session attribute: request.getSession().setAttribute("logged", user);
2) Checkin' if the user is logged: String status = request.getSession().getAttribute("logged") == null ? "deny" : "allow"; if (status.equals("deny")) // do something here...
The problem is that getAttribute() always returns null... Tks,
In JSP you don't have to use request.getSession() but session. If you always get attribute null, maybe user is always null or the session is invalidated at some point. You can check with session.isNew().