S
S
Sergey2014-06-18 16:10:58
MODX
Sergey, 2014-06-18 16:10:58

MODx Revo API - How to get modUser object with only user cookies?

In general, there is a puff script, it listens to the socket, sometimes some info + cookies are sent to the socket, that is, there is no full-fledged http, just a socket. I can't find the method in the documentation. I would like a boxed function, so as not to fence bicycles (a la a request to the database for users with a selection of ids, and then getting modUser).
Maybe initialize $_COOKIE and then initialize each time modx? But for me, this is not comme il faut - and if requests start coming from different users 10-20 times per second - there will be sadness.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-06-18
@r3l0c

$cond = array('sessionid:=' => $ssid);
        $q = $this->appInstance->modx->newQuery('modUserProfile', $cond);
        $q->limit(1);
        $q->prepare();
        $q->stmt->execute();
        $res = $q->stmt->fetch(\PDO::FETCH_ASSOC);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question