A
A
Aricus2020-05-06 22:13:54
PHP
Aricus, 2020-05-06 22:13:54

Why sometimes trying to localize a bug fixes it?

Sorry for the somewhat philosophical question, but I'm very interested in this pattern. Already 5 times I noticed that sometimes a systematic error occurs on the site, under which there are no grounds, and which disappears when you try to localize it. Let me take the last case as an example.

Sessions are no longer saved on the site when switching between pages, that is, the sessions have ceased to fulfill their function. The error was repeated on different browsers and different computers. I tried for three hours to find out the cause of the error, strained the technical support of the hosting. But in the end this error was fixed by this, after which the sessions began to be saved again:

if (!($_SESSION["test1"])) {
          $_SESSION["test1"] = "1";
        } else{
          echo '<script>console.log("Точка 3 - '.$_SESSION["test1"].'");</script>';
        }


What is the reason for this? Maybe some kind of deep caching on the server, which saves the erroneous execution of some piece of code until something changes in it? I can’t imagine any other explanation for such mysticism.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question