Só I have a ldap server that should be managed via php, I can modify anything in Apache,OpenLDAP or php. But as this site already covered I can't store a LDAP connection in a _SESSION variable on php... So is there anyway to store this on cookies? The user needs to be able to create new users and manage them. I am open to any solution that prevents the user to retype the password and doesn't include saving any passwords. Thank you on advance!
Asked
Active
Viewed 494 times
1 Answers
0
No, you cannot store LDAP connection in a cookie. LDAP connection is actually handler or pointer to a connection object and it can only exist on the server. However, nothing prevents you from maintaining map of LDAP connections in some sort of hash table with randomly generated keys of some sort and then store the key in the cookie. When user connects you retrieve the actual connection from the hash table on every request. If connection does not exist you ask the user to re-authenticate.

dtoubelis
- 4,677
- 1
- 29
- 32
-
Thank you, I still don't know how I'll request the connection to make it work on php or where the table should be stored, but I'll look in to it – Thiago Fontes Sep 17 '15 at 04:04
-
@ThiagoFontes, this is just a generic approach. I'm pretty sure you meant something different because there is no such thing as "LDAP connection" ;-) – dtoubelis Sep 17 '15 at 04:24