| <?php
|
|
|
| session_start();
|
|
|
|
|
| $_SESSION = array();
|
|
|
|
|
| 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();
|
|
|
|
|
| if (isset($_GET['logout_google']) && $_GET['logout_google'] === 'true') {
|
| $googleLogoutUrl = 'https://accounts.google.com/logout';
|
| header('Location: ' . $googleLogoutUrl);
|
| exit;
|
| }
|
|
|
|
|
| $redirect_url = isset($_GET['redirect']) ? $_GET['redirect'] : 'login.php';
|
|
|
|
|
| if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
|
|
| header('Content-Type: application/json');
|
| echo json_encode(['status' => 'success', 'redirect' => $redirect_url]);
|
| } else {
|
|
|
| header('Location: ' . $redirect_url);
|
| }
|
|
|
| exit;
|
| ?> |