misuzu/public/auth/logout.php

19 lines
419 B
PHP
Raw Normal View History

2019-03-08 01:35:53 +01: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:59:46 +01:00
if (csrf_verify('logout', RequestVar::get()->token->string())) {
2019-03-08 01:35:53 +01:00
setcookie('msz_auth', '', -9001, '/', '', true, true);
user_session_stop(true);
header(sprintf('Location: %s', url('index')));
return;
}
echo tpl_render('auth.logout');