We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23366
    • 3 Posts
    Hi.

    I upgraded from 1.04 to 1.05 last weekend. Everything went smooth.

    Now, our website contains a simple form which stopped working. Upon investigation, it turns out that when I do a post, $_SERVER[’REQUEST_METHOD’] doesn’t always contain ’POST’ but usually ’GET’. Also, when printing the contents of $_POST, $_REQUEST etc it seems that this is the same for all sessions/users logged in. So instead of using different storage (files?) for each session, it seems that all this data is stored in just one file or something.

    IE, I can’t seem to be able to modify the $_SESSION contents (only sometimes), and I asked a friend to take a look at this form, and he can see the exact same data in $_REQUEST etc as I can see. For example: this friend of mine sees a session variable ’ip’ which contains my ip-address... while it obviously should contain his. Also, a captcha is generated on this form when $_SESSION[’check’] is empty. Now, he sees the exact same captcha code as i do, and ’his’ $_SESSION[’check’] is set to the exact same value as mine.

    Here’s what I’m using to view this data from the form:

    echo $_SERVER[’REQUEST_METHOD’];
    foreach ($_POST as $k => $v) { print " $k = $v\n"; }
    foreach ($_REQUEST as $k => $v) { print " $k = $v\n"; }
    foreach ($_SESSION as $k => $v) { print " $k = $v\n"; }
    foreach ($_GET as $k => $v) { print " $k = $v\n"; }

    I just switched back to 1.04 by renaming the directories, and everything went OK there (just to check my host didn’t upgrade PHP or something). Been using this same code since 0.9 something, never seen an issue like this.

    Using PHP 5.2.15 on a redhat/centos Linux.

    Any suggestions?

    Thanks in advance!

    Piet.
      • 23366
      • 3 Posts
      BTW: I upgraded by copying the 1.05 files over the existing installation (after making a backup copy of that dir).
      I just checked: php.ini (which contains the path where the session files are stored) is still the same.

      Piet.
        • 4041
        • 788 Posts
        I also found some $_SESSION weirdness in 1.0.5 while working on some new events. I tracked the first issue to a typo in document.parser.class.inc.php in the getSettings() function, although after the typo fix there was still a few $_SESSION and $modx->config irregularities. I ended up changing a few things to get it to work like I thought it should (read experimental) and have attached a zip with the explanations and files I have modified so far in case someone wants to have a look at it and give feedback.
          xforum
          http://frsbuilders.net (under construction) forum for evolution
          • 3749
          • 24,544 Posts
          Breezer, did you file those as bugs? It’s important to do that so they can be checked out and fixed in the core code. Otherwise, they’ll slip through the cracks. If they’re not really bugs, there’s still no harm in filing them.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 23366
            • 3 Posts
            Fixed. The page was configured as ’Cacheable’ undecided
              • 21257 MODX Staff
              • 730 Posts
              piet, glad you got that sorted.
              Breezer, thanks for putting that together; I look forward to checking it out.
                Mike Schell
                Lead Developer, MODX Cloud
                Email: [email protected]
                GitHub: https://github.com/netProphET/
                Twitter: @mkschell