How should I store a user's LDAP password in a cookie?

后端 未结 2 530
野的像风
野的像风 2021-01-14 14:49

So I have this black box authentication method, handed down to me from the accounts people, which basically amounts to ldap_bind($connection, $username, $password)

2条回答
  •  春和景丽
    2021-01-14 15:00

    when the user logs in, give them a randomly generated "session cookie" (not strictly a session cookie because it will last longer than the browsing session) and store tuples of:

    user_id | cookie_id

    then hookup the cookie_id join the user_id with your user table and off you go.

提交回复
热议问题