error_log('MoodleSessionTest cookie could not be set in moodlelib.php:'.__LINE__);
error_log('Headers were already sent in file: '.$file.' on line '.$line);
} else {
- if (function_exists('array_fill_keys')) {
- //PHP 5.2.0
+ if (check_php_version('5.2.0')) {
setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
} else {
setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, '', $CFG->cookiesecure);
moodle_setlocale();
//clear session cookies
- if (function_exists('array_fill_keys')) {
+ if (check_php_version('5.2.0')) {
//PHP 5.2.0
setcookie('MoodleSession'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
if (empty($nomoodlecookie)) {
session_name('MoodleSession'.$CFG->sessioncookie);
- if (function_exists('array_fill_keys')) {
- //PHP 5.2.0
+ if (check_php_version('5.2.0')) {
session_set_cookie_params(0, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
} else {
session_set_cookie_params(0, $CFG->sessioncookiepath, '', $CFG->cookiesecure);
if (!empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie])) {
$_SESSION['SESSION']->has_timed_out = true;
}
- if (function_exists('array_fill_keys')) {
- //PHP 5.2.0
+ if (check_php_version('5.2.0')) {
setcookie('MoodleSessionTest'.$CFG->sessioncookie, $_SESSION['SESSION']->session_test, 0, $CFG->sessioncookiepath, '', $CFG->cookiesecure, $CFG->cookiehttponly);
} else {
setcookie('MoodleSessionTest'.$CFG->sessioncookie, $_SESSION['SESSION']->session_test, 0, $CFG->sessioncookiepath, '', $CFG->cookiesecure);