We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10405
    • 288 Posts
    Hi, my client wants their users to have a "Remember Password" tickbox on their login form (I'm using Login on an up to date version of Revo) so that they don't have to actually type their password. I've explained the security issues around this but they want to do it anyway, so... is this possible? The Login TPL doesn't seem to have this- how would it be added? What files need to be changed to enable this?

    Thanks!
      • 10405
      • 288 Posts
      Anyone know if this is possible? I've seen the functionality on countless other login forms in other systems so would have thought it can be done with the Login snippet?
        • 3749
        • 24,544 Posts
        Login has preHooks, so you should be able to use one to fill in the password field, but it would have to come from a cookie that you set in a login postHook or a plugin attached to one of the login events.

        I can't recommend this because of the obvious security issues, but it should definitely be possible.
          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
          • 10405
          • 288 Posts
          Quote from: BobRay at Aug 31, 2016, 10:09 AM
          Login has preHooks, so you should be able to use one to fill in the password field, but it would have to come from a cookie that you set in a login postHook or a plugin attached to one of the login events.

          I can't recommend this because of the obvious security issues, but it should definitely be possible.

          Thanks, I guess my next question is how would I set a cookie in a login postHook?

          I also found this code to add to the tpl for the Login form (in an older post in the forums), but sadly it doesn't work (the setting is ignored in every browser)

          <label class="loginRemembermeLabel">Remember Me
               <input class="loginRememberme" type="checkbox" name="rememberme" checked="checked" />
          </label>
          
          [ed. note: galahad5 last edited this post 10 years ago.]
            • 3749
            • 24,544 Posts
            I don't know of anything beyond this:

            http://php.net/manual/en/function.setcookie.php
              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
              • 10405
              • 288 Posts
              Have had a look and it doesn't really tell me how it can be done within MODX. Does anyone know of a way that this can be done from within the Login snippet? I'm amazed that Login doesn't have the "Remember password" feature when it's so commonplace on most other forms simply because users demand it. Anyone got any ideas? If I go back to my client and say it can't be done they'll simply point to all the examples where it can be... sad
                • 10405
                • 288 Posts
                Ok, so assuming Login doesn't offer this functionality, is there another login / access form in MODX that will do the job? Not sure how a standard PHP form can be made to integrate into the rest of the site- really don't want to have to go back to the client and say this isn't even a feature in MODX...
                  • 3749
                  • 24,544 Posts
                  You might be able to add a "remember me" checkbox to the Login Tpl chunk, save a cookie, and then bypass the usual login process for people with the cookie set using a snippet that's above the login snippet on the Login page.

                  Both Subscribe and Register send the user an email with a link that logs them in automatically, so it's definitely possible.
                    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
                    • 10405
                    • 288 Posts
                    Quote from: BobRay at Sep 19, 2016, 03:36 PM
                    You might be able to add a "remember me" checkbox to the Login Tpl chunk, save a cookie, and then bypass the usual login process for people with the cookie set using a snippet that's above the login snippet on the Login page.

                    Both Subscribe and Register send the user an email with a link that logs them in automatically, so it's definitely possible.
                    Thanks, I'm not sure how I can do that but I'll give it a go...
                      • 10405
                      • 288 Posts
                      Ok, well I've tried to figure this out but can't figure what to do... how would I save a cookie and what would I save it as on the system? If I were to bypass the login process, how does the user get logged in?

                      Has anyone else tried to add a "Remember Password" to Login? It's a feature that's used everywhere in login forms on the web, so as mentioned above it must be possible- somehow- but I can't see how.