Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8839459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:14:31+00:00 2026-06-14T10:14:31+00:00

In PHP, say I have an LDAP connection on page 1: $ldapconn = ldap_connect($ldapserver);

  • 0

In PHP, say I have an LDAP connection on page 1:

$ldapconn = ldap_connect($ldapserver);
if ($ldapconn) {
      // binding to ldap server
      $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
}
// do stuff here

Assuming everything goes well and I’m able to actually do stuff, how can I save this bind so that when a user clicks on a 2nd page I don’t need to again do an ldap_bind using their username/password. In essence I don’t want to store the password in the session if avoidable for security purposes, but I’d like to keep the connection so that I can reuse it on other pages.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:14:32+00:00Added an answer on June 14, 2026 at 10:14 am

    PHP LDAP doesn’t support persistent connections. Depending on what kind of LDAP queries you’re doing and how often, you could always set up a database that would store the username/password in encrypted state, then keep the ID to that record in the session (not a good idea to store usernames/passwords). Similar to what is answered here. Perhaps if you expand on what you’re trying to do will help us guide you in a better direction on how to accomplish it. If it’s simply for validating login then once they are validated against LDAP you can put a value in the session that says they’re validated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have info.php page with user info (id, name, age, etc). On this
Say I have a url like this in a php variable: $url = http://mywebsite.extension/names/level/etc/page/x;
let say I have a post that can be found on page post.php?pid=60 but
Say I have a PHP script, //main.php -> PID = 1002 <?php exec('ProcessOne'); exec('ProcessTwo');
Say I have a PHP script that creates a cookie that expires 10 days
Say I have an array in PHP that looks like so: $values = Array(
Say I have an array of key/value pairs in PHP: array( 'foo' => 'bar',
Say I have all these files in a folder: something(34324).php something(34).php something(3433454546).php something(65565).php something(9887).php
Lets say I have this code: <?php class hello { var $greeting = hello;
Say I have a rewrite that needs to pass the url to a PHP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.