On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Sirs,

    I have been using tracking cookies on my site so that when a user logs in he or she is taken back to the last visited allowed page. This cookie is user specific so that several logins mat use the same machine.

    My doc-not-found page also et this cookie by accident.

    I was astonished to discover that the doc-not found cookie was being set even when that page had clearly not been visited. I altered the cookies so the name was apge specific and found I almost always got the doc-not found cookie.

    I then added a modx log event to the document parser:

    if ($this->documentMethod == "alias") {
    // Check use_alias_path and check if $this->virtualDir is set to anything, then parse the path
    if ($this->config[’use_alias_path’] == 1) {
    $alias= (strlen($this->virtualDir) > 0 ? $this->virtualDir . ’/’ : ’’) . $this->documentIdentifier;
    if (array_key_exists($alias, $this->documentListing)) {
    $this->documentIdentifier= $this->documentListing[$alias];
    } else {
    $errorString= ’error doc: ’.$alias.’ ’;
    foreach ($this->documentListing as $key => $value) {
    $errorString .= $key.’=’.$value.’ | ’;
    }

    $this->logEvent(0, 3,$errorString, $source= ’Parser’);
    $this->sendErrorPage();

    I was astonished to discover that the offending document was favicon.ico which I have not specified anywhere (the browser does). There was also the odd missing image entry depending on page.

    It turns out that the alias system goes out and looks for anything that it cant find on the server whether or not it ends in the alias suffix (in my case .html) as well as .html. Of course this fails and throws this bizarre (if slighly useful) error. Can be fixed in .htaccess or document.parser.class. Your choice.

    Julian