-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogout.php
29 lines (24 loc) · 895 Bytes
/
logout.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
# This is a ONE-WAY logout script (hitting this out-of-order will not fully log out the user of all session types)
# Logout requests should never hit this script directly; the logout flow should always be
#
# https://aspc.pomona.edu/accounts/logout
# ↓
# https://aspc.pomona.edu/php-auth/logout.php?redirect=https%3A%2F%2Fcas1.campus.pomona.edu%2Fcas%2Flogout
# ↓
# https://cas1.campus.pomona.edu/cas/logout
#
# For BOTH Django apps and PHP apps (always start on the Django side first; it will take care of initiating the chain)
session_name("ASPC_PHP_SESSION");
session_set_cookie_params(0, "/", ".pomona.edu");
session_start();
session_destroy();
# Redirect to the CAS logout page, or the mainsite homepage
if (isset($_GET["redirect"]) && !empty($_GET["redirect"])) {
header("Location: " . $_GET["redirect"]);
}
else {
header("Location: https://aspc.pomona.edu/");
}
die();
?>