Directory Services

Setting Session Options

There are several options that can be read or set prior to binding to an LDAP server. These range from retrieving data about the server to setting up connection parameters. For example, if ldap_get_option is called with LDAP_OPT_HOST_NAME, it returns the name of the LDAP server to which the connection is made. Or, if ldap_set_option is called with LDAP_SIZELIMIT, it limits the number of entries to return from a search, or if it is called with LDAP_TIMELIMIT, it sets a limit on the number of seconds the server uses to wait for a bind or search request to complete before timing out.

Also, there are some LDAP directory features only available in LDAP, version 3. To verify the latest version supported on the client host, call ldap_get_option with LDAP_OPT_API_INFO. If version 3 is supported, call ldap_set_option with LDAP_OPT_PROTOCOL_VERSION, and LDAP_VERSION3 for the version parameter. The connection default is version 2.

For more information and a complete list of possible LDAP options, including code examples that show how to make the calls, see Session Options.