Q:

django: caching passwords for custom authentication

I am authenticating users in ldap, but this happens only once, when user is logging in. Afterwards I need to keep username and password, because before every ldap operation I need to make bind on ldap server before every operation. What is the safe way to cache this password (I can't store in the database or cookies) for as long as session persists.

A:

You may cache authentication credentials in sessions. If you are afraid that they may "leak" to disk, i.e. be cached in database, you may use memory based sessions.
With cache session engine (Using cached sessions) and memory based sessions this should be accomplished easily. 

