AnsweredAssumed Answered

Setting Splash Widget Cookie Expiration in WAB

Question asked by william.miller_WarrenCoGIS on Nov 8, 2016
Latest reply on Nov 8, 2016 by william.miller_WarrenCoGIS

Hello,

I was wondering if there is a way to have the splash widget cookie expire after a certain period of time? This way, after the period is over, the user would be presented with the splash screen and have to agree to the terms again.

I found the following code in the widget.js file of the splash widget.

onOkClick: function() {
        var isFirstKey = this._getCookieKey();
        if (this._requireConfirm) {
          if (this.confirmCheck.getValue()) {
            if (TokenUtils.isInConfigOrPreviewWindow() || this._confirmEverytime) {
              cookie(isFirstKey, null, {expires: -1});
            } else {
              cookie(isFirstKey, false, {
                expires: 1000,
                path: '/'
              });
            }
            this.close();
          }
        } else {
          if (this._showOption) {
            if (!TokenUtils.isInConfigOrPreviewWindow() && this.confirmCheck.getValue()) {
              cookie(isFirstKey, false, {
                expires: 1000,
                path: '/'
              });
            }
          } else {
            cookie(isFirstKey, null, {expires: -1});
          }
          this.close();
        }
      },

Does the expires: 1000 represent one thousand days?

Any input is appreciated. Thank you.

William

Outcomes