code: function sessionValueSwitch(req, queryParam, sessionKey) {
      if(req.query[queryParam]) {
          if(req.user && req.user.role !== 'guest' && typeify(req.query[queryParam]) === true) {
              req.session[sessionKey] = true;
          } else if(typeify(req.query[queryParam]) === false) {
              req.session[sessionKey] = false;
          }
      }
      return req.session ? req.session[sessionKey] : false;
  }
docs: Utility to check session values set by query params (such as preview mode)
  @param req
  @param queryParam
  @param sessionKey
  @returns {*|boolean}