I have some code that allows administrators to manage their organization's users/groups etc and execute extended commands (such as disabling accounts etc). This code is completely separate from the main user application and is only accessible by admins. As such I connect to LDAP using the admin user so I have access to all the commands I need.
What I'm wondering is if I can simply instantiate my LdapConnection, then bind to the server and then cache that connection for use throughout the app (store it in the Application object or in Session for instance) rather than instantiating it and binding every time I need to make a call? In other words, does that LdapConnection object ever expire or timeout or unbind after a certain amount of time? It looks like it has a 'Timeout' property on the connection object but that appears to be per each individual call. Am I correct to assume that once I bind I can just keep using that connection? Any design reason not to do this?
thank you!