code: public static void updateDirectEditFlagInSession(ServletRequest request) {
  
          String disabledParam = request.getParameter(CmsGwtConstants.PARAM_DISABLE_DIRECT_EDIT);
          if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(disabledParam)) {
              if (Boolean.parseBoolean(disabledParam)) {
                  ((HttpServletRequest)request).getSession().setAttribute(
                      CmsGwtConstants.PARAM_DISABLE_DIRECT_EDIT,
                      Boolean.TRUE);
                  String buttonLeft = request.getParameter(CmsGwtConstants.PARAM_BUTTON_LEFT);
                  if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(buttonLeft)) {
                      Integer left = null;
                      try {
                          left = Integer.valueOf(buttonLeft);
                          if (left.intValue() > 0) {
                              ((HttpServletRequest)request).getSession().setAttribute(
                                  CmsGwtConstants.PARAM_BUTTON_LEFT,
                                  left);
                          }
                      } catch (NumberFormatException e) {
                          // malformed parameter, ignore
                      }
                  }
              } else {
                  ((HttpServletRequest)request).getSession().removeAttribute(CmsGwtConstants.PARAM_DISABLE_DIRECT_EDIT);
              }
          }
      }
docs: Updates the direct edit flag in the session and also storing the button left info if available.<p>
  
  @param request the request