Quote:
Originally Posted by Dave
I'm pretty sure you must put define('CSRF_PROTECTION', false); on top of the file.
|
Thank you for your reply.
I tried adding this line on top:
PHP Code:
define( "CSRF_PROTECTION", false );
I also tried this line on top:
PHP Code:
require_once( '/forum/core/vb/vb.php' );
vB::init();
define( "CSRF_PROTECTION", false );
Both are giving me the same error message and the user is not logged out.
Here is the my final code so far:
PHP Code:
define( "CSRF_PROTECTION", false );
require_once( '/forum/includes/vb5/autoloader.php' );
vB5_Autoloader::register( '/forum' );
vB5_Frontend_Application::init( 'config.php' );
$api = Api_InterfaceAbstract::instance();
//Get user info
$vb_userInfo = vB_Api::instance( 'user' )->fetchUserinfo();
$logouthash = $vb_userInfo[ 'logouthash'];
//Logout
$logoutInfo = $api->callApi('user', 'logout', $logouthash);
//Redirect
header( "Location: /index.php" );