Resource icon

Using XenForo Code in other applications

Lukas W.

Well-known member
Lukas W. submitted a new resource:

Using XenForo Code in other Applications - Some often-asked basics

Introduction
One of the most-asked questions in the XenForo Dev Section is: How do I access data from XenForo in other applications? Generally speaking, there is two ways you can go about this: If your application is in a different language than PHP, or resides on a different server, you can utilize the built-in API to access most data, and push and pull content from and to your XenForo installation. If you're on the same server, and your other...

Read more about this resource...
 

SAS1024

Active member
@Lukas W. thank you for you instruction!

I have some problems with getting current logged in user.

I logged in on my forum.
I created external script test.php in forum root with following content:
PHP:
<?php

require(__DIR__ . '/src/XF.php');
XF::start(__DIR__);
var_dump(XF::visitor());
But when I open this script in browser (test script have access to all XF cookies) and look at var_dump output, I can't see any current logged in user data. All fields are empty, like from guest visitor.

Please, help me to resolve this issue.
 
Top