<?php

if ( !defined( 'SMARTY_DIR' ) ) {
	include_once( 'init.php' );
}

$osDB->query( 'DELETE FROM ! WHERE userid = ?', array( ONLINE_USERS_TABLE, $_SESSION['UserId'] ) );

$osDB->disconnect();

session_destroy();

setcookie($config['cookie_prefix']."osdate_info[username]", $cookie['username'], strtotime("-1day"), "/" );

setcookie($config['cookie_prefix']."osdate_info[dir]", $cookie['dir'], strtotime("-1day"), "/" );

unset( $_COOKIE[$config['cookie_prefix'].'osdate_info'] );

unset( $cookie );

unset( $_SESSION );

header('location: index.php');
exit;
?>