本文整理匯總了PHP中session::stop方法的典型用法代碼示例。如果您正苦於以下問題:PHP session::stop方法的具體用法?PHP session::stop怎麽用?PHP session::stop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類session
的用法示例。
在下文中一共展示了session::stop方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: stop_session
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');
}
示例2: header
<?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');
}
}
示例3: stop
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: '{$login}' Password: '{$password}'.");
示例4: logout
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;
}
示例5: session
<?php
include 'session.class.php';
$session = new session();
$session->start();
$session->set('test', 'Kada Rachid');
$session->stop();
echo $session->get('test');
示例6: stop_session
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');
}