本文整理匯總了PHP中CAppUI::token_expiration方法的典型用法代碼示例。如果您正苦於以下問題:PHP CAppUI::token_expiration方法的具體用法?PHP CAppUI::token_expiration怎麽用?PHP CAppUI::token_expiration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CAppUI
的用法示例。
在下文中一共展示了CAppUI::token_expiration方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
}
CSessionHandler::setHandler(CAppUI::conf("session_handler"));
// Start session
CSessionHandler::start();
// Ignore aborted HTTP request, so that PHP finishes the current script
ignore_user_abort(true);
// Register shutdown function to end the session
register_shutdown_function(array("CSessionHandler", "writeClose"));
// Check if the session was made via a temporary token
// and save its expiration date
if (isset($_SESSION["token_expiration"])) {
CAppUI::$token_expiration = $_SESSION["token_expiration"];
}
// Reset session if it expired
if (CAppUI::isTokenSessionExpired()) {
CAppUI::$token_expiration = null;
// Free the session data
CSessionHandler::end(true);
// Start it back
CSessionHandler::start();
}
// Check if session has previously been initialised
if (empty($_SESSION["AppUI"]) || isset($_GET["logout"])) {
$_SESSION["AppUI"] = CAppUI::init();
}
CAppUI::$instance =& $_SESSION["AppUI"];
CAppUI::$instance->session_name = $session_name;
if (!isset($_SESSION["locked"])) {
$_SESSION["locked"] = false;
}
CAppUI::checkSessionUpdate();
示例2: applyParams
/**
* Applies token's params to redirect the user
*
* @return void
*/
function applyParams()
{
// Save token expiration in the session
CAppUI::$token_expiration = $this->getTokenExpiration();
CAppUI::$token_restricted = $this->restricted == 1;
CValue::setSessionAbs("token_expiration", CAppUI::$token_expiration);
$params = $this->getParams();
if (isset($params["tab"]) && empty($params["a"])) {
$params["a"] = $params["tab"];
unset($params["tab"]);
}
foreach ($params as $key => $value) {
$_GET[$key] = $value;
$_REQUEST[$key] = $value;
}
}