2016-04-19, 01:43 AM
I added custom code (global.php) on our forum, once the user logged-in it creates session. The code below:
Now, I dont know where to put the session_destroy() code when the user logged-out. It seems that mybb doesn't use session_start and logout button is just link with logout key (can't find the build-in function of it).
// Create session for this user
require_once MYBB_ROOT.'inc/class_session.php';
$session = new session;
$session->init();
$mybb->session = &$session;
//code added below//
ini_set('session.save_path',realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/site_sessions'));
session_start();
Now, I dont know where to put the session_destroy() code when the user logged-out. It seems that mybb doesn't use session_start and logout button is just link with logout key (can't find the build-in function of it).