本文整理匯總了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';
}
}
示例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;
}
示例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);
}
示例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 {
示例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();