本文整理汇总了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();