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

    I have modx 2.3.1 site where registration, submit registration, login, members only area page for logged users and all works.

    But I found that even if you use two browsers (safari and firefox manager for test on site) after logging out in safari as administrator in Firefox does not display a login form to specify username and password. Is that means, that modx session is valid for whole computer?

    Does somebody know why my registration and login on website works only when I'm logged into the manager as Administrator?

    Many thanks!

    This question has been answered by BobRay. See the first response.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      No. Each browser maintains its own cookies. Do you have the snippets cached, or uncached? If you have them cached, then their output will be cached in the page, no matter what your login status is. Login and registration snippets must be called uncached - [[!Login? ... ]]
        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
        • 48696
        • 41 Posts
        Thanks for reply, snippet call is uncached
        [[!Login? &loginResourceId=`53` &logoutResourceId=`54` &loginTpl=`lgnLoginTpl_cs`]]
        and in resource Login (49) in Settings is checked Cacheable...should it be also unchecked?

        Quote from: sottwell at Nov 25, 2014, 06:30 AM
        No. Each browser maintains its own cookies. Do you have the snippets cached, or uncached? If you have them cached, then their output will be cached in the page, no matter what your login status is. Login and registration snippets must be called uncached - [[!Login? ... ]]
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          No, most of the resource can be cached.

          When a snippet is cached, its output is cached as part of the page's content, and the snippet tags are removed, so next time the page is loaded only the original cached output will be there.

          Uncached snippets don't remove the snippet tags, and the snippet's output is not part of the cached file. So the next time the page is loaded, the snippet tags are still there to get processed for that particular page request.
            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
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Setting up permissions can be difficult at first. I don't do it very often, so it still takes me a few tries to get it right when I do need to use them.
              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
              • 48696
              • 41 Posts
              I'm trying to solve it for a week, and I still have not succeeded, so I tried to write on forum, to be sure if I do not make some stupid mistake...

              Quote from: sottwell at Nov 25, 2014, 06:44 AM
              Setting up permissions can be difficult at first. I don't do it very often, so it still takes me a few tries to get it right when I do need to use them.
                • 4172
                • 5,888 Posts
                Is this login-snippet-call directly at your template or somehow nested into other chunks or something.

                What is the code of your chunk lgnLoginTpl_cs?

                Does it work, when you put just
                [[!Login]]
                directly into your template?
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 48696
                  • 41 Posts
                  Hi Bruno,

                  code of chunk lgnLoginTpl_cs is:

                  <div class="loginMessage">[[+errors]]</div>
                  
                  <form action="[[~[[*id]]]]" method="post" class="form">
                                  <label class="loginUsernameLabel">[[%login.username? &namespace=`login` &topic=`default` &language=`cs`]]
                                      <input type="text" name="username" class="cfinput">
                                  </label>
                                  
                                  <label class="loginPasswordLabel">[[%login.password? &namespace=`login` &topic=`default` &language=`cs`]]
                                      <input type="password" name="password" class="cfinput">
                                  </label>
                                  <input class="returnUrl" type="hidden" name="returnUrl" value="[[+request_uri]]">
                  
                                  [[+login.recaptcha_html]]
                                  
                                  <input class="loginLoginValue" type="hidden" name="service" value="login">
                                  <input type="submit" class="button eshop" name="Login" value="[[+actionMsg]]">
                  </form>
                  


                  Login snippet is called from resource id 49 in content:

                  [[!Login? &loginResourceId=`53` &logoutResourceId=`54` &loginTpl=`lgnLoginTpl_cs`]]
                  [[-testlogin]]
                  

                  Template for login resource is BaseTemplate

                  When i put
                  [[!Login]]
                  into BaseTemplate and clear cache and logout all users and clear cookies in browser is still same...
                    • 48696
                    • 41 Posts
                    Hooray!

                    I solved it with new Resource Group for all visitors, where is resource with login page (49) belongs to User Group with Element Category Access to Login snippet Category smiley
                      • 3749
                      • 24,544 Posts
                      Generally, Login pages should not be in *any* Resource Group. That will make them available to anyone.
                        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