[pmwiki-users] I want to auth based on pre-existing _SESSION variable with name in it.

Petko Yotov 5ko at 5ko.fr
Sun Sep 27 02:04:34 PDT 2026


On 27/09/2026 05:52, Christopher Cox wrote:
> On 9/26/26 10:46 PM, Petko Yotov wrote:
>> On 27/09/2026 04:34, Christopher Cox wrote:
>>> I get an error: PHP Warning:  Undefined global variable $_SESSION in 
>>> /var/www/ agora/pmwiki/local/config.php on line 56
>> 
>> Add before the conditional:
>>    pm_session_start();
>> 
>> If you later define any of these $EnableCookieSecure, 
>> $EnableCookieHTTPOnly, $CookieSameSite, they should be moved before 
>> pm_session_start().
>> 
>> Petko
>> 
> 
> Just to add, I added session_start, but will change to 
> pm_session_start,

This should clear the warning about Undefined global variable $_SESSION.

> I also added $AuthUser[$session_user] = true; in the conditional.

The value is not expected to be true but an array containing as elements 
the user's hashed password and user groups.

It should be enough if the users are defined in SiteAdmin.AuthUser.

If you have a custom page store class like PerGroupSubDirectories or 
SQLite, this needs to be earlier in config.php, so that that page store 
is available to AuthUser when it reads SiteAdmin.AuthUser.

Petko


-- 
If you upgrade :  https://www.pmwiki.org/Upgrades



More information about the pmwiki-users mailing list