If cookie is not set. Set it again otherwiser the site will be blocked

See BT#8883
1.9.x
Julio Montoya 11 years ago
parent 6f61e3c49a
commit ae64b54b2e
  1. 6
      index.php
  2. 2
      main/inc/lib/main_api.lib.php

@ -14,13 +14,13 @@ $language_file = array('courses', 'index', 'userInfo');
// Maybe we should change this into an api function? an example: CourseManager::unset();
$cidReset = true;
// Set cookie for check if client browser are cookies enabled
setcookie('TestCookie', 'cookies_yes', time()+3600*24*31*12);
require_once 'main/inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'userportal.lib.php';
require_once 'main/chat/chat_functions.lib.php';
// Set cookie for check if client browser are cookies enabled
setcookie('TestCookie', 'cookies_yes', time()+3600*24*31*12);
// The section (for the tabs).
$this_section = SECTION_CAMPUS;

@ -3240,6 +3240,8 @@ function api_not_allowed($print_headers = false, $message = null)
get_lang('BackTo').' '.get_lang('CampusHomepage').'</a><br />', 'error',
false
);
// Set cookie again.
setcookie('TestCookie', 'cookies_yes', time()+3600*24*31*12);
} else {
// The session is over and we were not in a course,
// or we try to get directly to a private course without being logged

Loading…
Cancel
Save