code: protected IPortalCookie locatePortalCookieInSession(HttpSession session) {
          synchronized (WebUtils.getSessionMutex(session)) {
              final String portalCookieId =
                      (String) session.getAttribute(SESSION_ATTRIBUTE__PORTAL_COOKIE_ID);
              if (portalCookieId == null) {
                  return null;
              }
              IPortalCookie portalCookie = this.portletCookieDao.getPortalCookie(portalCookieId);
              return portalCookie;
          }
      }
docs: Check the {@link HttpSession} for the ID of the Portal Cookie. This is useful if the customer
  does not wish to accept cookies.
  
  @param session
  @return