Subject: | Using PerlSetVar for SecretKey fails inside of VirtualHost |
Using this module as described in the Synopsis fails if the PerlSetVar WhateverDBI_SecretKey directive is contained within a VirtualHost. The reason for this appears to be due to the fact that these variables are not available during server startup[1].
One workaround is to place the PerlSetVar WhateverDBI_SecretKey directive outside of the VirtualHost settings. This can be a nuisance, esp. when dealing with a multi-vhost server. The other workaround is to include the Apache::AuthCookieDBI module inside of a <perl> section as follows:
<perl>
use Apache::AuthCookieDBI;
</perl>
The PerlSetVar directive still needs to be placed *before* the <perl> section. I do not know if this solution would work for multiple vhosts that use AuthCookieDBI. It seems likely that the module would get loaded by the first vhost before seeing the PerlSetVar directive for the second vhost. Seems like there should be an alternate solution to reading the keys in the BEGIN block.
Thanks,
William
[1] http://aspn.activestate.com/ASPN/Mail/Message/modperl/1920838