RSS Feed/News Error: The session key must be overridden.

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,724
Points
823

Reputation:

I have built this standalone script for logging in the user programmatically.

<?php
error_reporting(E_ALL);
ini_set('display_errors',1);

$basePath = "/web/forum";

// Require the XenForo autoloader
require $basePath . '/src/XF.php';

// Initialize XenForo
XF::start($basePath);

// Set the user ID you want to log in
$userIdToLogin = 13; // Replace with the actual user ID

// Fetch the user
$user = XF::em()->find('XF:User', $userIdToLogin);

XF::app()->session()->set('sessionKey', 12345)...

Read more

Continue reading...
 
Status
Not open for further replies.
Top