public function destroy($id) { apc_delete($this->prefix . $id); if (!empty($this->db_link)) { parent::destroy($id); } return true; }
public function logout() { /* * compares session token against get method to see if it's the actual user */ if (Sessions::get('token') == Requests::get('token')) { Sessions::destroy(); } }
<?php require "Sessions.php"; $ses = new Sessions(); $ses->init(); $user = isset($_SESSION['user']) ? $_SESSION['user'] : null; if ($user != null) { $ses->destroy(); header("location: ../Index.php"); }
<?php require '../class/sessions.php'; $objses = new Sessions(); $objses->init(); $objses->destroy(); header('Location: ../index.php');