docs: @Override
      public void updatePortalCookie(HttpServletRequest request, HttpServletResponse response) {
          // Get the portal cookie object
          final IPortalCookie portalCookie = this.getOrCreatePortalCookie(request);
  
          // Create the browser cookie
          final Cookie cookie =
                  this.convertToCookie(
                          portalCookie, this.portalCookieAlwaysSecure || request.isSecure());
  
          // Update the expiration date of the portal cookie stored in the DB if the update interval
          // has passed
          final DateTime expires = portalCookie.getExpires();
          if (DateTime.now()
                  .minusMillis(this.maxAgeUpdateInterval)
                  .isAfter(expires.minusSeconds(this.maxAge))) {
              try {
                  this.portletCookieDao.updatePortalCookieExpiration(
                          portalCookie, cookie.getMaxAge());
              } catch (HibernateOptimisticLockingFailureException e) {
                  // Especially with ngPortal UI multiple requests for individual portlet content may
                  // come at
                  // the same time.  Sometimes another thread updated the portal cookie between our
                  // dao fetch and
                  // dao update.  If this happens, simply ignore the update since another thread has
                  // already
                  // made the update.
                  logger.debug(
                          "Attempted to update expired portal cookie but another thread beat me to it."
                                  + " Ignoring update since the other thread handled it.");
                  return;
              }
  
              // Update expiration dates of portlet cookies stored in session
              removeExpiredPortletCookies(request);
          }
          // Update the cookie in the users browser
          response.addCookie(cookie);
      }