本文整理匯總了PHP中session::destroy方法的典型用法代碼示例。如果您正苦於以下問題:PHP session::destroy方法的具體用法?PHP session::destroy怎麽用?PHP session::destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類session
的用法示例。
在下文中一共展示了session::destroy方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: perform
function perform()
{
$chat_room_data =& fetch_mapped_by_url();
session::destroy('last_message_ids');
setcookie('chat_room_id', $chat_room_data['object_id'], time() + 365 * 24 * 3600);
chat_user::enter_chat_room($chat_room_data['object_id']);
return parent::perform();
}
示例2: logout
public function logout()
{
session::destroy();
if (isset($_COOKIE['user'])) {
setcookie('user', "", 1, "/");
}
header('Location: ../index');
exit;
}
示例3: logout
function logout()
{
session::destroy();
header('location: ../login');
/*
* In Tutorial MVC, the header is
* header('location: ' . URL . 'login');
*/
exit;
}
示例4: logout
function logout()
{
session::destroy();
if (session::get("isLoggedIn")) {
$this->add_sys_msg("There was an error. You may still be logged in.");
} else {
$this->add_sys_msg("You have successfully logged out.");
}
$this->view->render("index/index");
}
示例5: __construct
function __construct()
{
parent::__construct();
auth::handleLogin();
$type = session::get('role');
if ($type != 'owner') {
session::destroy();
header('Location: ' . URL . 'index');
}
}
示例6: __construct
public function __construct()
{
parent::__construct();
$logged = session::get("isLoggedIn");
if ($logged == false) {
session::destroy();
echo $logged;
header('location: ' . $this->base_url . '/index/error/You tried to access a page without logging in.');
echo "fail";
exit;
}
$this->view->js = array(VIEWS_DIR . 'dashboard/js/default.js');
}
示例7: perform
function perform(&$request, &$response)
{
$chat_room_data =& fetch_requested_object();
session::destroy('last_message_ids');
setcookie('chat_room_id', $chat_room_data['object_id'], time() + 365 * 24 * 3600);
if ($chat_user_data = chat_user::get_chat_user_data()) {
if ($chat_user_data['chat_room_id'] != $chat_room_data['object_id']) {
chat_system::leave_chat_room($chat_user_data['id'], $chat_user_data['nickname'], $chat_user_data['chat_room_id']);
chat_system::enter_chat_room($chat_user_data['id'], $chat_user_data['nickname'], $chat_room_data['object_id']);
}
$this->view->set('nickname', $chat_user_data['nickname']);
}
parent::perform(&$request, &$response);
}
示例8: set
public static function set($type, $key, $value)
{
if (DEBUG) {
$check = self::_get($type);
if (!empty($check)) {
self::$messages[$type] = $check;
if (array_key_exists($key, self::$messages[$type])) {
unset(self::$messages[$type][$key]);
}
self::$messages[$type][$key] = $value;
} else {
self::$messages[$type][$key] = $value;
}
session::set("debug", self::$messages);
} else {
session::destroy("debug");
}
}
示例9: logout
public static function logout()
{
return session::destroy();
}
示例10: logout
public function logout()
{
if (session::item('spy_id')) {
$oldID = session::item('user_id');
$this->login(session::item('spy_id'), 0, array());
session::delete('spy_id');
router::redirect('cp/users/edit/' . $oldID);
}
$authID = session::item('auth_id');
$userID = session::item('user_id');
$ipaddress = substr(input::ipaddress(), 0, 15);
$useragent = substr(input::useragent(), 0, 255);
$this->deleteSession($authID, $userID, $ipaddress, $useragent);
// Action hook
hook::action('users/account/logout', $userID);
cookie::delete('sessdata');
session::set('auth_id', 0);
session::set('user_id', 0);
session::delete(array('auth_id', 'user_id'));
session::destroy();
session::initialize();
return true;
}
示例11: pageLogout
public function pageLogout()
{
session::destroy();
$this->redirect('login');
}
示例12: close
function close($id)
{
session::destroy('open' . $id);
}
示例13: logout
public static function logout()
{
session::destroy();
$tokenExist = cookie::exists(TOKEN_NAME);
if ($tokenExist) {
$token = cookie::get(TOKEN_NAME);
try {
$db = new database(DBTYPE, DBHOST, DBNAME, DBUSER, DBPASS);
$data = $db->select("users_session", "*", "token = '{$token}'", "fetch");
$agent_id = $data['agent_id'];
$db->delete("users_session", "token = '{$agent_id}'");
cookie::delete(TOKEN_NAME);
} catch (Exception $ex) {
cookie::delete(TOKEN_NAME);
}
}
redirect::to("login");
}
示例14: logout
function logout()
{
session::destroy();
header('location: ' . URL . 'login');
exit;
}
示例15: _session_destroy
function _session_destroy()
{
session::destroy('chat_user_id');
session::destroy('chat_user_data');
}