We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44665
    • 60 Posts
    sebastian-marinescu Reply #11, 8 years, 1 month ago
    Also we could try a little thing, just to get sure of some things:

    1. Create a snippet called "Check"
    2. In every resource of every context add [[!Check]] (the exclamation mark makes it uncached)
    3. Add following code into the Check-Snippet:
    <?php
    $user = $modx->getUser();
    echo "User: " . $user->get('username');
    echo "<br>";
    
    $state = $modx->getSessionState();
    switch ($state) {
      case 1: $sessionState = "SESSION_STATE_UNINITIALIZED"; break;
      case 2: $sessionState = "SESSION_STATE_UNAVAILABLE"; break;
      case 3: $sessionState = "SESSION_STATE_EXTERNAL"; break;
      case 4: $sessionState = "SESSION_STATE_INITIALIZED"; break;
    }
    echo "Session: " . $sessionState;
    echo "<br>";
    
    $auth = $modx->user->isAuthenticated('mgr');
    echo "isAuthenticated for mgr: " . var_export($auth, true);
    echo "<br>";
    
    $pm = 'view_offline';
    echo "Permission to see offline: " . var_export($modx->hasPermission($pm), true);
    echo "<br>";


    Now I don't have your scenario set up, but maybe it helps us debugging this better and maybe something awkward stands out.

    When I try this in a browser where I am logged in a MODX-Manager, it outputs:
    User: Sebastian
    Session: SESSION_STATE_UNINITIALIZED
    isAuthenticated for mgr: true
    Permission to see offline: true

    In another browser where I am not authenticated:
    User: (anonymous)
    Session: SESSION_STATE_UNINITIALIZED
    isAuthenticated for mgr: false
    Permission to see offline: false

    Somehow in both cases it logs Session: SESSION_STATE_UNINITIALIZED for my setup, but maybe it shows something different in your case. Anyway let us know if you found something or what it outputs in your case smiley
      • 3749
      • 24,544 Posts
      From the Context Access image you posted, you only have Context Access ACL entries for 'mgr' and 'web'. Try adding identical entries for the other contexts (if you haven't already).

      Flush permissions and sessions after making any changes.
        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
        • 51838
        • 8 Posts
        Thanks for all the help so far, guys, greatly appreciated!

        Unfortunately, things got worse... definitely not my week, pfff.

        I ended up completely reinstalling MODX, clear all my browsers cookies/chache (tested in 3 different ones: firefox/ffdeveloper/chrome) and I just can't login into the manager. I enter my (new) user name & password & the screen just keeps reloading, without error message, and without access.

        So I waited 3 whole days - in the hopes it had something to do with MODX & just needed some time to 'forget' my previous installation - but still no change.

        I'm pretty desperate by now, I'm very new to MODX but absolutely LOVE what I've seen so far and just don't want to go back to Joomla or any other cms.

        Thanks again for any suggestions!
          • 3749
          • 24,544 Posts
          Did you run setup after copying the new files?
            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
            • 51838
            • 8 Posts
            Quote from: BobRay at Mar 01, 2016, 10:26 PM
            Did you run setup after copying the new files?

            I tried completely removing MODX and reinstalling it through cPanel's Softaculous Didn't work so removed the new installation again and tried a manual install by downloading and unpacking the latest MODX Rev. I then uploaded everything to the root via ftp and ran setup. All good, new database works, new files are there, login is accepted but just doesn't open the MODX manager, only reloads.

            I didn't update the new installation with my previous site content. So no new/edited resources, extras, themes, settings, users, ... just a totally clean MODX installation, starting from scratch.

            I did clear all cache/cookies from all my browsers and rebooted my system. I don't have my own server, but have shared hosting @GreenGeeks. They tried help solve this for days, without any luck.

            Just to be clear, in the meantime, my original thread has shifted from 'no subdomain preview' to 'no manager login'.

            Extra strangeness: I'm currently designing a website for a client on Joomla, all ran very smoothly but the day before launch, same thing happens here. Can't login anymore to the Joomla Admin, just keeps reloading without error message.

            Off course I don't expect you to solve this one too, I'm just saying: coincidence or are the internet gods messing with me??

            Also, in both cases, I've tried to log in on different devices (laptop, pc, phone, tablet) - as did the MODX & GreenGeeks helpdesk - just to make sure it wasn't an issue with my computer. No need to say: nothing works.

            Thanks for the input! [ed. note: bohobravo last edited this post 8 years, 1 month ago.]
              • 3749
              • 24,544 Posts
              Do you see anything in the MODX error log? core/cache/logs/error.log

              If you enter the wrong credentials, do you get a message saying so?

              Does the username or password contain any non-alphanumeric characters?

              The most common cause of Login failures like yours is a problem with storing or retrieving the session data. The fact that you have a similar problem with a Joomla site, makes that cause even more likely.

              You can create a file with just this code and access it directly:

              <?php
              phpinfo();
              


              Check the Session section, especially the session.save_path variable and the permissions on the directory it points to.

              Don't forget to delete the file when you're done.

              Another possibility is a troublesome browser add-on, though you've probably tried other browsers already.
                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
                • 51907
                • 8 Posts
                I have exactly he same problem not being able to see (as Administrator) 'new' context when site is offline though I can see 'web' context. When in system settings site_status=0, I can only see new context when I create in it own setting site_status=1. It is absolutely independent on permissions, etc. Revo 2.4.3

                Edit: The problem is only present when context is another domain (which is not alias nor points to modx root, but is on the same server (same IP) and has .htaccess, index.php and config.core.php files on its root). When context is simply a subfolder there are no problems.

                Anyway now I have more of a problem on how to make fully functional multidomain modx website, when additional domains are on the same server, but doesn't point to modx root and are not aliases. [ed. note: treniota last edited this post 8 years, 1 month ago.]