1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?php function init_logout(&$S) { if (isset($S['session'])) { $S['session']->delete(); } setcookie($S['conf']['cookiename'], '', 1, $S['cookie_dir'], '', false, true); if (isset($_REQUEST['go'])) { header('Location: '.url($_REQUEST['go'])); } } function body_logout() { echo print_success('Logged out.'); echo '<a href="'.url('login').'">Log back in</a>'; } ?>