We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43899
    • 26 Posts
    I am using the "login" plug-in to create access to private pages within web context.
    I have followed all instructions in the HowTo http://rtfm.modx.com/display/ADDON/Login.Basic+Setup and http://rtfm.modx.com/display/revolution20/Making+Member-Only+Pages.

    After entering username+passwd MODX is always returning to the login page without any error message.

    I have triple checked permissions, resource groups, user groups, flushed access rights, used different browser for testing ... nothing helped.

    What other tests can I run and how can I figure out where the authorization process is broken?

    Using: MODX Revolution 2.2.6-pl (traditional)
    PlugIns: login 1.8.1-pl, Babel and TinyMCI

    Thanks a lot
    Christoph
      • 36470
      • 12 Posts
      As I see, you are using Babel, which means multilingual site with multiple contexts, right?
      Try to set "session_cookie_path" system setting to "/" (without the quotes).
      Also, log-out the manager when logging in the frontend.
        • 38669
        • 51 Posts
        I'm wondering. Are you sure they aren't actually logged in, just that the redirect is wrong?
          • 43899
          • 26 Posts
          hi Svetoslav,
          Unfortunately setting the session_cookie_path didn't solve it.
          Logging out of manager, using IE instead of Firefox, clearing cache didn't help either.
          From the public pages I get to the public login page and there it loops ...
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Are you sure the login snippet is called uncached?
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 43899
              • 26 Posts
              Quote from: sottwell at May 30, 2013, 01:12 AM
              Are you sure the login snippet is called uncached?
              This is my login call. Private page 32 is existing

              [[!Login? &loginTpl=`lgnLoginTpl` &loginResourceId=`32`]]
                • 43084
                • 34 Posts
                Quote from: christoph_mics at May 31, 2013, 01:51 AM
                This is my login call. Private page 32 is existing

                [[!Login? &loginTpl=`lgnLoginTpl` &loginResourceId=`32`]]

                Is your test user really logged in after you enter the user and password?

                Try to go to your private page 32 manually (by typing the URL on the browser) after you apparently 'log in' once and see if you can really see it. If the server returns you to the login page, maybe the user doesn't have permissions to see your resource 32 and the login page is set as the default redirection page after an authentication error.

                Or check if your 32 resource is indeed published.

                If those tips don't work, another thing that happened to me is: does your test user have the same email address as another user? I found that if two users have the same email address, the login plug-in starts doing weird things when trying to log in. If that's the case, try changing the email address of your user or use a different account for testing.
                  • 43899
                  • 26 Posts
                  Unfortunately no change ...
                  Apparently user is not logged in - typing URL of private page redirects to public homepage which is default behavior for unauthorized access (or nonexisting page).
                  Private page is published and part of resource group.

                  It is not the E-mail address either - all users have different E-mail
                    • 3749
                    • 24,544 Posts
                    Try redirecting the user to a published, unprotected page with this snippet:


                    [[!IsLoggedIn]]



                    <?php
                    /* IsLoggedIn snippet */
                    $output = $modx->user->get('username') . "\n";
                    
                    if ($modx->user->hasSessionContext('web')) {
                       $output .= 'Web Access';
                    } else {
                       $output .= 'NO Web Access';
                    }
                    
                    return $output;
                      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
                      • 43899
                      • 26 Posts
                      Hi Bob,
                      As expected the user is (anonymous) NO Web Access.

                      In the meantime I setup MODX from scratch in a test environment and experimented with login plugin.
                      With only one context login is working fine
                      With multiple contexts in Babel, login behaves as experienced before.

                      I figured out that with key 'site_url' set for 'web' context then login is NOT working.
                      When deleting this key in web context the login is working properly (but Babel is broken of course)

                      What would be the next thing to try???