Пример #1
0
function is_session_alive($session_id, $no_ka = 0)
{
    global $version, $client_db;
    $session = values("SELECT alive FROM `" . $client_db . "`.`sessions` WHERE alive=1 AND session_id = '" . mysql_escape_string($session_id) . "' AND sess_expire > NOW()");
    if (count($session) > 0) {
        if ($no_ka == 0) {
            keep_alive($session_id);
        }
        return 1;
    } else {
        session_kill($session_id);
        return 0;
    }
}
Пример #2
0
 /**
  * Destroy session handler
  *
  * {@see http://php.net/manual/en/function.session-set-save-handler.php}
  *
  * @param string $sid
  * @return bool success
  */
 public function handler_destroy($sid)
 {
     session_kill($sid);
     if (isset($this->record->id) and $this->record->sid === $sid) {
         try {
             $this->database->release_session_lock($this->record->id);
         } catch (Exception $ex) {
             // ignore problems
         }
         $this->record = null;
     }
     $this->lasthash = null;
     return true;
 }
 /**
  * To delete a host, we must delete all current sessions that users from
  * that host are currently engaged in.
  *
  * @param   string  $sessionidarray   An array of session hashes
  * @return  bool                      True on success
  */
 function end_local_sessions(&$sessionArray)
 {
     global $CFG;
     if (is_array($sessionArray)) {
         while ($session = array_pop($sessionArray)) {
             session_kill($session->session_id);
         }
         return true;
     }
     return false;
 }
<?php

/*
 Copyright (C) 2003 
 Alberto Alcocer Medina-Mora
 root@b3co.com

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
define("BADGER_ROOT", "../..");
include BADGER_ROOT . "/core/SessionManager/session.ses.php";
if ($_GET['f'] == 1) {
    session_flush();
} else {
    session_kill();
}
header("Location: SessionManagerTest.php");
require_once BADGER_ROOT . "/includes/fileFooter.php";
Пример #5
0
 public function handler_destroy($sid)
 {
     session_kill($sid);
     if (isset($this->record->id) and $this->record->sid === $sid) {
         $this->database->release_session_lock($this->record->id);
         $this->record = null;
     }
     return true;
 }
Пример #6
0
function session_flush()
{
    global $sess, $_db_table, $_db_table_config;
    session_kill();
    $sql = "delete from {$_db_table} where sid ='{$sess}';";
    query($sql);
    $sql = "delete from {$_db_table_config} where sid = '{$sess}'";
    query($sql);
    return mysql_error() != "" ? false : true;
}
Пример #7
0
function session_unsetVariable($var)
{
    if (isset($_SESSION)) {
        unset($_SESSION[$var]);
        if (!count($_SESSION)) {
            // Note that this will prevent us from creating another session this same request.
            // This does not seem to cause a problem at the moment.
            session_kill();
        }
    }
}