10 Replies Latest reply on Jul 1, 2008 6:59 AM by (John_Groh)

    Login to a Personal Page

    921creative Level 1
      It seems like ADDT should make this easy, but I'm getting a headache trying to figure it out. All I want to do is have a user get redirected to his personal page after a successful login. I know I have to set the Session variable to the kt_login_id value in the recordset, correct? But how do I set this parameter in the "If Login Succeeds, go to" field in the Login Settings box? Is there a tutorial anywhere on how to do this seemingly simple thing?
        • 1. Re: Login to a Personal Page
          921creative Level 1
          I guess I'm really just trying to figure out how ADDT handles sessions that are started by a user logging in. How do you pass the sessions between pages that a user visits while he is logged in? I want a user to be able to visit several pages but only see information related to his row in the database as he browses. I'm assuming the Session is what determines who is logged in and therefore, what to display?

          Currently after a user logs in, I have no way of knowing if a session is in effect because no database information will display.
          • 2. Re: Login to a Personal Page
            921creative Level 1
            OK, I think I figured it out. In my recordset, I had the Session Variable set to my user id column rather than my user name column. It seems to be keeping my sessions from page to page now.
            • 3. Re: Login to a Personal Page
              Level 1
              adobebrian,

              ADDT set Session Variables will only work automaticaly on pages that have the ADDT "Restrict Access To Page" server behavior applied to them. Otherwise you would need to call session_start() to have access to the SESSION variables.

              You should be able to use the $_SESSION['kt_login_id'] to dynamically set their custom user page.

              Shane
              • 4. Re: Login to a Personal Page
                921creative Level 1
                What is the difference between using $_SESSION['MM_Username'] and $_SESSION['kt_login_id']? One of my sites would only work with the [MM_Username] variable set.
                • 5. Re: Login to a Personal Page
                  Günter Schenk Level 4
                  -------
                  What is the difference between using $_SESSION['MM_Username'] and $_SESSION['kt_login_id']?
                  -------

                  $_SESSION['MM_Username'] is available when using DW´s native login procedure, and $_SESSION['kt_login_id'] is set when using ADDT -- I don´t think you can have them both available at the same time.

                  Cheers,
                  Günter Schenk
                  Adobe Community Expert, Dreamweaver
                  • 6. Re: Login to a Personal Page
                    921creative Level 1
                    OK, that makes sense. Thanks.
                    • 7. Re: Login to a Personal Page
                      I am trying to do the same thing. I have 10 people that will use a form to enter information into a database (individual sales notes). I want them to redirect after logging in to a list that brings up their notes (and only their notes). I dont want them to be able to access anyone else's but their own. How can I do this? (and Im sorry but you may need to dumb down the response...this "simple" project is giving me fits!)
                      • 8. Re: Login to a Personal Page
                        921creative Level 1
                        Experts, please correct me if I'm wrong, but here's what I learned so far as to how to do this:

                        Go to the page where the sales notes will be displayed (perhaps notes.php).

                        Create a new Recordset for that page. Name the Recordset and choose the Connection and Table you are pulling the records from.

                        Under Filter, choose "id". Make sure the "=" is chosen in the next pull down menu. Choose "Session Variable" in the next menu. Finally, put "kt_login_id" into the text box. This will set a session variable based on the id of the user who is logging in to the notes page.

                        Subsequently, any page you want users to access from this page should have the same Recordset filter and "Restrict Access to Page" server behavior implemented. The session you started when the user logged in to the notes page will be used to identify that particular user until he/she logs out.
                        • 9. Re: Login to a Personal Page
                          Level 1
                          Cool Brian, I will try this out and let everyone know if it solves my problem.
                          • 10. Re: Login to a Personal Page
                            Level 1
                            Sweet, it worked and even though I was on the right track, I just couldnt figure it out. Thanks for your help!

                            Oh and, another thing, I used a Nextensio list instead of building one myself for the "landing page" after logging in. All I did was create the recordset like you said(in my case, I filtered on the foreign key to the "users" table instead of the id and used the session variable kt_login_id) and then used the recordset for source in the list instead of going directly to the table. Works like a charm.