misuzu/public/auth/logout.php

19 lines
430 B
PHP
Raw Normal View History

2019-03-08 00:35:53 +00:00
<?php
use Misuzu\Request\RequestVar;
require_once '../../misuzu.php';
if (!user_session_active()) {
header(sprintf('Location: %s', url('index')));
return;
}
2019-03-18 20:47:25 +00:00
if (csrf_verify('logout', RequestVar::get()->token->value('string', ''))) {
2019-03-08 00:35:53 +00:00
setcookie('msz_auth', '', -9001, '/', '', true, true);
user_session_stop(true);
header(sprintf('Location: %s', url('index')));
return;
}
echo tpl_render('auth.logout');