From f6c12b0853c6e2d2cdd824f0e35a0566a4da8082 Mon Sep 17 00:00:00 2001 From: Laurent Opprecht Date: Mon, 25 Jun 2012 11:03:35 +0200 Subject: [PATCH] see #4797 Session expired wrong message --- index.php | 2 +- main/inc/lib/main_api.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index d4696cf2c5..93093b00cb 100644 --- a/index.php +++ b/index.php @@ -43,7 +43,7 @@ $htmlHeadXtra[] =' '; //set cookie for check if client browser are cookies enabled -setcookie("TestCookie", "cookies_yes", time()+3600); +setcookie('TestCookie', 'cookies_yes', time()+3600*24*31*12); $controller = new IndexManager($header_title); diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index e210fe2c0a..9c75720cc7 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -2811,7 +2811,7 @@ function api_not_allowed($print_headers = false, $message = null) { } $msg = null; // Check if the cookies are enabled. If are enabled and if no course ID was included in the requested URL, then the user has either lost his session or is anonymous, so redirect to homepage - if( !isset($_COOKIE["TestCookie"]) && empty($_COOKIE["TestCookie"]) ) { + if( !isset($_COOKIE['TestCookie']) && empty($_COOKIE['TestCookie']) ) { $msg = Display::return_message(get_lang('NoCookies').'

'.get_lang('BackTo').' '.get_lang('CampusHomepage').'
', 'error', false); } else { $msg = Display::return_message(get_lang('NotAllowed').'

'.get_lang('PleaseLoginAgainFromHomepage').'
', 'error', false);