This content has been marked as final. Show 10 replies
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.
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.
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.
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.
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.
Adobe Community Expert, Dreamweaver
OK, that makes sense. Thanks.
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!)
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.
Cool Brian, I will try this out and let everyone know if it solves my problem.
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.