code: public Object getSession(HttpServletRequest req) {
          if (req.getCookies() == null) {
              return null;
          }
  
          Cookie cookie = Arrays.stream(req.getCookies()).filter(c -> c.getName().equalsIgnoreCase("ValidationSession")).findFirst().orElse(null);
  
          if (cookie == null) {
              return null;
          }
          return this.sessionMap.get(cookie.getValue());
      }
docs: Gets session.
  
  @param req the req
  @return the session