dmccabe Posted March 17, 2008 Share Posted March 17, 2008 I have finally got my ldap authentication script working as it needs to. Now when someone logs in, I can grab their full name and what department they are part of from AD server, but how can I store them so they dont have to log in on every page. basically I have put my authentication script in header.php then once they have logged in if they go to another page which calles header.php then they have to log in again. How can I make it remember them for the full time they are on the site and also so I can grab their dept no matter what page I am on. Link to comment https://forums.phpfreaks.com/topic/96507-remembering-someones-details-sessions/ Share on other sites More sharing options...
ikmyer Posted March 17, 2008 Share Posted March 17, 2008 <?php session_start(); $_SESSION['fullname'] = $row['fullname']; // $row['fullname'] being the info from the db you check against. $_SESSION['dept'] = $row['dept']; // same for $row['dept'] ?> That will store the info in a session from page to page... then you can access the session: <?php session_start(); echo $_SESSION['fullname']; echo $_SESSION['dept']; ?> Or do auth checks or whatever Check out - http://us2.php.net/manual/en/function.session-start.php for more info.... Link to comment https://forums.phpfreaks.com/topic/96507-remembering-someones-details-sessions/#findComment-493999 Share on other sites More sharing options...
pauleth Posted March 17, 2008 Share Posted March 17, 2008 I completely agree with IKMYER - for what you are trying to do, sessions definitely seem the way to go... Link to comment https://forums.phpfreaks.com/topic/96507-remembering-someones-details-sessions/#findComment-494015 Share on other sites More sharing options...
dmccabe Posted March 17, 2008 Author Share Posted March 17, 2008 thanks guys I will have a look in to it. Link to comment https://forums.phpfreaks.com/topic/96507-remembering-someones-details-sessions/#findComment-494021 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.