code: public Long getLoggedUserId() {
      HttpSession session = getRequest().getSession(false);
      return session == null ? null : (Long) session.getAttribute("loggedUserId");
    }
docs: Returns the identifier of the logged in user. If the user hasn't logged in, returns
  <code>null</code>.
  
  @return The identifier of the logged in user, or <code>null</code> if the user hasn't logged in