Answer the question
In order to leave comments, you need to log in
How to work with sessions in MODx?
I wrote a snippet that writes data to the session, but the problem is that the snippet only works for authorized users. If an unauthorized user visits the pages, no session entries are made. How can this be fixed?
Answer the question
In order to leave comments, you need to log in
It depends on how you generally record. Show at least the snippet code, chtoli
Weird. Everything works. If you want access to the session from a custom script, then you need to add something like this at the beginning of it:
require_once '../../config.core.php'; // путь от вашего скрипта до файла конфига
require_once MODX_CORE_PATH . 'config/' . MODX_CONFIG_KEY . '.inc.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('web');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question