當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SessionManager::sessionStart方法代碼示例

本文整理匯總了PHP中SessionManager::sessionStart方法的典型用法代碼示例。如果您正苦於以下問題:PHP SessionManager::sessionStart方法的具體用法?PHP SessionManager::sessionStart怎麽用?PHP SessionManager::sessionStart使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SessionManager的用法示例。


在下文中一共展示了SessionManager::sessionStart方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: startSession

function startSession()
{
    $colon_position = strpos($_SERVER['HTTP_HOST'], ':');
    $server_host = $colon_position > -1 ? substr($_SERVER['HTTP_HOST'], 0, $colon_position) : $_SERVER['HTTP_HOST'];
    SessionManager::sessionStart('project645', 0, '/', $server_host);
    if (!isset($_SESSION['language']) || !in_array($_SESSION['language'], ['en_US', 'fr_CH', 'de_CH'])) {
        $_SESSION['language'] = 'en_US';
    }
}
開發者ID:qqalexqq,項目名稱:Projects_645,代碼行數:9,代碼來源:global_functions.php

示例2: checkAccess

 function checkAccess($methodName)
 {
     $result = true;
     $securedMethods = ["getGoods", "getAdminOrder", "updateGood", "getGood", "getGoodImages", "deleteGood", "getDescriptionKeys", "getGoodsKeys", "getNextGoodCode", "uploadImagesForGood", "updatePrices", "listBooklets", "getBooklet", "saveBooklet", "deleteBooklet", "getBookletBackgrounds", "saveOrder"];
     if (in_array($methodName, $securedMethods)) {
         $result = isset($_SERVER['HTTPS']) && SessionManager::sessionStart() && AuthManager::isAuth();
     }
     return $result;
 }
開發者ID:gingerP,項目名稱:shop,代碼行數:9,代碼來源:controller-api.php

示例3: iniciarSessao

function iniciarSessao($request)
{
    $usuario = new Usuario();
    $usuario->serializeArray("Usuario", $request['usuario']);
    $usuario->logado = 1;
    SessionManager::sessionStart($usuario->login, 10, '/');
    $usuarioService = new UsuarioService();
    $usuario = $usuarioService->alterar($usuario);
    echo json_encode($usuario);
}
開發者ID:jhmachado,項目名稱:anotation,代碼行數:10,代碼來源:session.php

示例4: unset

            // Now we unset the obsolete and expiration values for the session we want to keep
            unset($_SESSION['OBSOLETE']);
            unset($_SESSION['EXPIRES']);
        }
        protected static function validateSession()
        {
            if (isset($_SESSION['OBSOLETE']) && !isset($_SESSION['EXPIRES'])) {
                return false;
            }
            if (isset($_SESSION['EXPIRES']) && $_SESSION['EXPIRES'] < time()) {
                return false;
            }
            return true;
        }
    }
    SessionManager::sessionStart('session_security');
} else {
    if ($_define_session_engine === 1) {
        /*
        # ----------------------------------------------------------------------
        # SESSION: CUSTOM
        # ----------------------------------------------------------------------
        */
        /* --- INI SET --- */
        ini_set('session.cookie_httponly', 1);
        ini_set('session.use_only_cookies', 1);
        ini_set('session.entropy_file', '/dev/random');
        ini_set('session.cookie_lifetime', 0);
        ini_set('session.cookie_secure', 1);
        session_start();
    } else {
開發者ID:nickyudha,項目名稱:spalosophy,代碼行數:31,代碼來源:_session.php

示例5: header

<?php

/*header('Content-type: application/json; charset=UTF-8');*/
include_once 'import';
include_once 'admin_pages';
include_once 'service';
$page = $_GET['page'];
if ($page == 'redirect') {
    $host = $_SERVER['HTTP_HOST'];
    header("Location: https://{$host}/admin/login");
    exit;
}
$sessionStarted = SessionManager::sessionStart();
if ($sessionStarted) {
    if (AuthManager::isAuth()) {
        //AUTH SUCCESS
        switch ($page) {
            case 'contacts':
                $page = new AdminPage_Contacts();
                echo $page->getHtml();
                break;
            case 'prices':
                $page = new AdminPage_Prices();
                echo $page->getHtml();
                break;
            case 'tree':
                $page = new AdminPage_Tree();
                echo $page->getHtml();
                break;
            case 'goods':
                $page = new AdminPage_Goods();
開發者ID:gingerP,項目名稱:shop,代碼行數:31,代碼來源:controller-admin.php


注:本文中的SessionManager::sessionStart方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。