PHP Function LDAP_Unbind
Article about php function ldap_unbind
LDAP stands for Lightweight Directory Access Protocol and it's a protocol that is used to access "Directory Servers". A directory server is a special kind of database that holds information in a hierarchical structure (a bit like your hard disk directories). At the highest level of the hierarchy we find things such as countries. Lower levels contain entries for companies, organisations or places. Yet lower still we might find entries for people, equipment or documents.
The ldap_bind function asynchronously authenticates the client with the LDAP server by providing a distinguished name and some type of authentication credential, such as a password. The type of credentials required depends on the method set in the LDAP_BIND_METHOD parameter. Caution: Unless a TLS (SSL) encrypted session is established, the bind operation sends the password in plain text. This means that if an unauthorized person is monitoring network traffic, they can read the password.
The ldap_unbind function closes the connection and frees resources associated with the LDAP session handle. This function must be called when you are finished using the LDAP session, even if you have not previously called ldap_bind. If you fail to call ldap_unbind, resources could remain allocated to the LDAP session handle and cause a failure when calling other LDAP functions. If you use multithreading, call ldap_unbind in the main thread to prevent locking the session handle.