| 12345678910111213141516171819202122232425262728293031 |
- <?php
- /**
- * File for the login action.
- *
- * Implements an action function to be called from the {@see Controller}.
- *
- * @category Action
- */
- /**
- * Logs the user out and redirects to the login page.
- *
- * Invalidates cookies and session variables.
- *
- * @return int 0.
- * @category Action
- * @global User The logged-in user.
- */
- function action(){
- $USER = null;
- setcookie("user_id", null, time() - 3600);
- setcookie("user_token", null, time() - 3600);
- session_regenerate_id();
- $_SESSION['session'] = false;
- $_SESSION['user_id'] = "";
- header("Location: /");
- die();
- return 0;
- }
- ?>
|