Added auth support and a helper script, targeting frankenphp
This commit is contained in:
parent
8f545c3f67
commit
0783e08fe9
8 changed files with 655 additions and 4 deletions
20
logout.php
Normal file
20
logout.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
// logout.php
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/auth.php';
|
||||
|
||||
auth_session_start();
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
$_SESSION = [];
|
||||
|
||||
if (ini_get('session.use_cookies')) {
|
||||
$params = session_get_cookie_params();
|
||||
setcookie(session_name(), '', time() - 42000, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
|
||||
}
|
||||
|
||||
session_destroy();
|
||||
|
||||
echo json_encode(['ok' => true]);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue