We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    This has nothing to do with MySQL cache. I think you might be having an issue with an Extra that is adding this Captcha code.
      • 23134
      • 33 Posts
      Quote from: BobRay at Nov 20, 2011, 05:03 PM
      Petja, I'm unable to make this happen on MODX 2.1.5.

      Are you using SPForm or FormIt, or your own code to call the captcha utility? Make sure any snippet calls are uncached:

      [[!SnippetName]]

       [[!FormIt?
      	&hooks=`spam,formit2resource`
      	&validate=`nospam:blank,
      	name:required,
          pagetitle:required,
      	content:required:stripTags,
      	email:required:email,
      	reg_captcha:check_reg_captcha`
      	&customValidators=`check_reg_captcha`
      ]]


      check_reg_captcha:
      <?php
      ob_start();
      var_dump($_SESSION['test']);
      echo '<hr>';
      var_dump($_SESSION['veriword']);
      $dump = ob_get_clean();
      
      //if ($scriptProperties['value'] !== $_SESSION['veriword'] and !$_SESSION['captcha_ok']) {
      if ($scriptProperties['value'] !== $_SESSION['veriword']) {
      	//return 'error code in captcha <br> Value-> '.$scriptProperties['value'].'<br> From session-> '.$_SESSION['veriword'];
      	return $dump;
      	
      }else{
      //	$_SESSION['captcha_ok'] = true;
      	return true;
      }
      


        • 15083
        • 697 Posts
        Quote from: opengeek at Nov 21, 2011, 08:12 AM
        The entire cache_db feature in MODX 2.1.x is broken. Just disable cache_db.

        The associated system settings should be removed from the release if it does not work?
        There is nothing to tell the user that db_cache does not work. Is it that the toggle simply does nothing?
          • 22303 MODX Staff
          • 10,725 Posts
          It works, it just not clear the cache appropriately in many cases. So do not use it for critical things like session storage, or if you have problems seeing fresh data in the manager.

          The bugs were reported and fixed for 2.2, so try rc1 if you need cache_db to work, especially with sessions (see cache_db_session settings).
            • 23134
            • 33 Posts
            Sorry, but all not works...
            Say, please, as forcibly remove all the cache and re-set a session variable (veriword) from PHP code?
            Help me please.... ^-(
              • 23134
              • 33 Posts
              In \core\components\formit\model\formit\fivalidator.class.php

              on line 225 i change from:
              /* attempt to grab custom validator */
                          /** @var modSnippet|null $snippet */
                          $snippet = $this->modx->getObject('modSnippet',array('name' => $type));
                          if ($snippet) {

              To:
              /* attempt to grab custom validator */
                          /** @var modSnippet|null $snippet */
                          $snippet = $this->modx->getObject('modSnippet',array('name' => $type));
              			$snippet->setCacheable(false);
                          if ($snippet) {
              


              again not work...
                • 3749
                • 24,544 Posts
                Go to System -> System Settings.
                Find the cache_db setting.
                Set it to "no".
                  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
                  • 23134
                  • 33 Posts
                  Quote from: BobRay at Nov 21, 2011, 10:24 AM
                  Go to System -> System Settings.
                  Find the cache_db setting.
                  Set it to "no".

                  Bob, look: https://forums.modx.com/thread/71961/hello-trouble-with-caching-session#dis-post-400914

                  This has already been

                  And I find that - if i'm logout from manager - $_SESSION['veriword'] is NULL ....
                    • 23134
                    • 33 Posts
                    Again dont work...
                    Need diving in source code...
                    It's very big bug in modx....

                    Ehhhh.... ^-(
                      • 3749
                      • 24,544 Posts
                      I think the problem is more likely to be with the server configuration than MODX.

                      It could be a problem with session.save_path and/or session.gc_maxlifetime.

                      Who is your host and is it a windows or *nix server?
                        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