本文整理汇总了PHP中session_kill函数的典型用法代码示例。如果您正苦于以下问题:PHP session_kill函数的具体用法?PHP session_kill怎么用?PHP session_kill使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了session_kill函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_session_alive
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: handler_destroy
/**
* 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;
}
示例3: end_local_sessions
/**
* 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;
}
示例4: Copyright
<?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: handler_destroy
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: session_flush
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: session_unsetVariable
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();
}
}
}