コード例 #1
0
ファイル: run.php プロジェクト: szchkt/leaklog-web
include_once 'config/config.php';
include 'config/database.php';
$message = array();
include 'config/messages.php';
function session_restart($init_only = false)
{
    $flash = $_SESSION['flash'];
    if (!$init_only) {
        session_destroy();
        session_start();
    }
    if (!array_key_exists('flash', $_SESSION)) {
        $_SESSION['flash'] = is_array($flash) ? $flash : array();
    }
}
session_restart(true);
// Helpers
require_once 'lib/system/helpers.php';
require_once 'lib/system/html_helpers.php';
if (file_exists(MODULES_PATH . 'main/application/application_helpers.php')) {
    include MODULES_PATH . 'main/application/application_helpers.php';
}
// Models
require_once 'lib/system/model.php';
// Controllers
require_once 'lib/system/controller.php';
if (!file_exists(MODULES_PATH . 'main/application/application_controller.php')) {
    error();
}
include MODULES_PATH . 'main/application/application_controller.php';
// Router
コード例 #2
0
<?php

$logout_location = "../index.php?page=login&section=loggedout";
session_start();
$requested_logout = true;
if ($requested_logout) {
    session_restart();
}
// Now the session_id will be different every browser refresh
print session_id();
function session_restart()
{
    if (session_name() == '') {
        // Session not started yet
        session_start();
    } else {
        // Session was started, so destroy
        session_destroy();
    }
}
header("Location: {$logout_location}");
?>