4 Replies Latest reply on May 15, 2008 4:33 PM by (Dale_Andrew)

    Stay Logged In After Registration?

      I created a registration page in dreamweaver using developer's toolbox registration wizard. Registration form works great, but after registration, I'm tying to immediatley send users to inside the restricted site (keep them logged in). Right after registration, it's asking for a username and password (login reqest). Is there a way to make the registation form also count as the "first time" login? I'm trying to avoid the user having to login right after registration.

      Just wanted to mention that the login form is a bit on the whacky side. In my site, when a visitor registers, I am using only an email and a username at registration. So at login, the username field is the for the email and the password field is for the username. So on the login form, the kt_login_user form field actually checks the e_mail field of the registation table in the database. The kt_login_password form field actually checks the user_name column of the registation table in the database. It's a bit backwards, but registration and login worked great (except for the issue of having to login immediatly after registration). Any help greatly appreciated - I've been pulling my hair out for days over this!
        • 1. Re: Stay Logged In After Registration?
          Level 1
          Does anyone know of any resources relating to this issue? I'm simply trying to find out how to keep a user logged in after they use the ADDT registration form/transaction (instead of having to log back in immediately after). I've looked and looked but can't seem to find anything. I can imagine others have had this issue and there is probably a simple way of solving the issue. I appreciate any help (links to articles, tutorials, etc) on this subject.

          Thanks -
          • 2. Re: Stay Logged In After Registration?
            Hello Dale,
            Going through the old mx kollection documentation, i came across this. Hope it helps you with what you are trying to achieve.

            Next you have to add the automatic login functionality. A user is considered logged-in (from the MX Kollection 3 point of view) when two session variables are set (three if using access levels): kt_login_id and kt_login_user. The first stores the user ID and the second stores the user name. So, in order to login the user, you just have to set the correct values for these session variables after the registration process completes. To execute an action after the registration takes place, you must add a Custom Trigger of the AFTER type.

            To implement the automatic login, follow the next steps:

            Open the register page in Dreamweaver if necessary.

            Add a Custom trigger from the Server Behaviors tab > + > MX Kollection > Forms > Custom trigger.

            In the Basic tab of the user interface that opens you must add the code that sets the session variable values. Copy and paste the section of code that matches your particular server model below:

            For PHP:

            $_SESSION['kt_login_id'] = $tNG->getPrimaryKeyValue();
            $_SESSION['kt_login_user'] = $tNG->getColumnValue('name_usr');

            For ASPVBScript:

            Session("kt_login_id") = tNG.getPrimaryKey
            Session("kt_login_user") = tNG.getColumnValue("name_usr")
            SET Trigger_Custom = Nothing

            For ColdFusion:

            SESSION.kt_login_id = tNG.getPrimaryKeyValue();
            SESSION.kt_login_user = tNG.getColumnValue ("name_usr");

            Next you have to edit the Insert transaction added by the User Registration Wizard, so that it will no longer redirect to the login page. Double click the Insert Transaction in the register page. Replace the value in the After inserting, go to text field with the index page - click the Browse button to select it from the site root or the page that you intend the user to go after successfully logging in


            You may also want to read more at this forum
            http://www.interaktonline.com/Products/Free-Products/PHAkt/Product-Forum/Details/2204/Logi n+and+Registration/
            • 3. Re: Stay Logged In After Registration?
              Level 1
              phil amoh , <br /> <br />Thanks for the helpful info. It's the first sign of hope that I've found with this issue. I created the new session variable triggers (as you can see below), but I'm still not able to stay logged in after registation when I tested it. I'm a php newbie so it probably has to do with my syntax. Can you tell if I did it correctly or do you have any ideas on how it should look? Thank you - Dale <br /> <br /><?php<br />if (!session_id()) session_start();<br />if ($_SERVER["REQUEST_METHOD"] == "POST")     {<br />  $_SESSION["kt_login_user"] = $tNG->getColumnValue('name_usr'); <br />}?> <br /><?php<br />if (!session_id()) session_start();<br />if (isset($_POST["KT_Insert1"]))     {<br />  $_SESSION["kt_login_id"] = $tNG->getPrimaryKeyValue(); <br />}<br />?>