function stop_session() { //tester si session exist $ss_id = cookie::Exists('ssid') ? cookie::Get('ssid') : ""; global $db; $updatessid_sql = "update session set expir = CURRENT_TIMESTAMP where id ='{$ss_id} '"; if (!$db->Query($updatessid_sql)) { $db->Kill('erreur Update session'); } $session = new session(); $session->stop(); cookie::Delete('eonape'); }
<?php if (Mreq::tg('_tsk') == 'errorjs' && Mreq::tg('noscript') == 0) { //exit(Mreq::tg('noscript').' 1'); header('location:./'); } else { //exit(Mreq::tg('noscript').' 2'); $session = new session(); if (!$session->stop()) { return false; } else { view::load('ajax', 'errorjs'); } }
if ($administrator == 1) { return true; } else { return false; } } public static function stop() { session_unset(); session_destroy(); } } session::start(); // Handle logouts if (isset($_GET['logout'])) { session::stop(); header('Location: index.php'); exit; } // Handle logins if (isset($_GET['login'])) { if ($_GET['login'] == "guest" && $enable_guest_mode == 1) { $_SESSION['guest'] = 1; } if ($_GET['login'] == "guest" && $enable_guest_mode != 1) { $_SESSION['guest'] = 0; } if ($enable_user_login != 1) { $login = $_POST['login']; $password = $_POST['password']; logSQL("POSSIBLE HACK ATTEMPT. Person was from IP: '" . getIP() . "'. and used Username: '******' Password: '******'.");
public function logout() { global $db; //Expire opened Session for this user $val_session['expir'] = 'CURRENT_TIMESTAMP'; $whr_session['id'] = $this->token; if (!$db->UpdateRows('session', $val_session, $whr_session)) { $this->log .= $db->Error(); $this->error = false; $this->log .= '</br>Problème fermeture sessions ouvertes'; } $session = new session(); if (!$session->stop()) { return false; } return true; }
<?php include 'session.class.php'; $session = new session(); $session->start(); $session->set('test', 'Kada Rachid'); $session->stop(); echo $session->get('test');
function stop_session() { //tester si session exist global $db; $updatessid_sql = "update session set expir = CURRENT_TIMESTAMP where id ='" . $_SESSION['ssid'] . "'"; if (!$db->Query($updatessid_sql)) { $db->Kill('erreur Update session'); } $session = new session(); $session->stop(); cookie::Delete('eonape'); }