Bug 65172 - authn_socache doesn't cache well with authn_dbd if query contains additional columns
Summary: authn_socache doesn't cache well with authn_dbd if query contains additional ...
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_authn_socache (show other bugs)
Version: 2.4.46
Hardware: PC All
: P2 major with 6 votes (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2021-03-06 21:00 UTC by Avi
Modified: 2022-02-17 00:49 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Avi 2021-03-06 21:00:04 UTC

As recommended in the docs, I tried configuring authn_dbd with authn_socache.
This works well if AuthDBDUserPWQuery contains only the password column, but if it contains additional columns then it doesn't cache them and their value cannot be used.

AuthDBDUserPWQuery "SELECT password, name, mail, ... FROM users"

in such case, the value of name, mail, etc.. will not be defined as AUTHENTICATE_ variables as expected.
Comment 1 Dave Pearson 2021-04-20 20:26:03 UTC
I can confirm this behavior, and would like to add that the first time the login is used, all will appear well, it is only subsequent accesses (i.e. via cache) that do not show any of the AUTHENTICATE_ variables.
This can be quite easily shown by simply calling a phpinfo(); in a test php file - upon refreshing the page using F5 in the browser, the AUTHENTICATE_ variables all clearly disappear after firstly being visible after login. 

Changing the

AuthBasicProvider socache dbd


AuthBasicProvider dbd

"fixes" this issue, but it will no longer cache the credentials.