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

    I have a requirement to allow user who have just registered to be automatically logged in.

    IE:
    - User fills out the registration form
    - User gets redirected to a page and is automatically logged in using the detals they just entered in the reg page.

    Anyone come across this before?

    Cheers,

    Justin
      • 15083
      • 697 Posts
      Guys im trying to edit the Login function in webloginpe.class.php
      I created a new function called: LoginReg (same as above apart from difference below)

      I’m passing in the new username and password, however it’s not creating a valid session.
      Am I missing something obvious here, I thought the above would work?




        • 1169
        • 312 Posts
        Quote from: jusmeig at Feb 25, 2010, 05:16 PM

        Guys im trying to edit the Login function in webloginpe.class.php
        I created a new function called: LoginReg (same as above apart from difference below)

        I’m passing in the new username and password, however it’s not creating a valid session.
        Am I missing something obvious here, I thought the above would work?


        you should be able to use:-
        !WebLoginPE? &type=`register` &regType=`instant`!]
        


        Should be no need to change code.
          DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31
          • 15083
          • 697 Posts
          Quote from: allanb at Feb 25, 2010, 06:23 PM

          you should be able to use:-
          !WebLoginPE? &type=`register` &regType=`instant`!]
          

          Should be no need to change code.

          This will not work.
          Setting that param only serves to set a password locally,rather than having the webloginpe class set one and mail it out ot the user.
          I want to automate logging in, upon register?!
            • 1169
            • 312 Posts
            Sorry jusmeig.

            I thought that was what you required.

            Did you mean to show some code.

            You talk about above and below.
              DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31
              • 15083
              • 697 Posts
              Guys I am calling the Login function, which is working and the session is getting set.
              A new line is being added into the active user, so it all looks good.

              However when I redirect to another page the session is then empty?
                • 15083
                • 697 Posts
                Guys when I log in normall I get the seeion var:
                modx.session.created.time

                However if I call the Login function from within the wpe class this is not getting set?
                Anyone help me out here?
                  • 14315
                  • 6 Posts
                  I need the same feature.

                  Does someone succeed in modifying webloginpe in order to achieve autologin after registration ?

                  Thanks.