本文整理匯總了PHP中func::getSERVER方法的典型用法代碼示例。如果您正苦於以下問題:PHP func::getSERVER方法的具體用法?PHP func::getSERVER怎麽用?PHP func::getSERVER使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類func
的用法示例。
在下文中一共展示了func::getSERVER方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
function __construct($sessionKey = '')
{
$this->sessionStart($sessionKey, false);
$this->sessionData['curr_session_id'] = session_id();
$this->sessionData['start_session_time'] = date('Y-m-d H:i:s');
$sCurrentDBSessionID = Func::POSTGET('curdbsessid');
if ($sCurrentDBSessionID) {
$this->sCurrentDBSessionID = $sCurrentDBSessionID;
}
$this->restoreSession();
//check access to fordev mode
$this->checkFORDEV();
// уязвимость 'session fixation'
if (!empty($this->sessionData['curr_session_id'])) {
# много динамических ip, часто слетает сессия, пока закомментим
//$ip = func::getRemoteAddress(false);
//$ip = substr($ip, 0, strrpos($ip, '.') - 1);
$useragent = func::getSERVER('HTTP_USER_AGENT', 'no user agent');
$charset = func::getSERVER('HTTP_ACCEPT_CHARSET', 'hello from IE');
$fixHash = md5($useragent . $charset);
if (!isset($this->sessionData['hash'])) {
$this->sessionData['hash'] = $fixHash;
} elseif ($this->sessionData['hash'] != $fixHash) {
if (!empty($_POST['sessid']) && (strpos(strtolower($useragent), 'adobe flash') !== false || in_array(strtolower($useragent), array('shockwave flash', 'adobe flash player 10')))) {
/*
swfupload:
HTTP_USER_AGENT = 'Shockwave Flash';
HTTP_ACCEPT_CHARSET = '';
*/
} else {
session_regenerate_id();
$this->sessionData = array();
$this->sessionData['hash'] = $fixHash;
}
}
}
}