18 require_once
'../../include/init.inc';
20 $site_network_id = array_get_index($_GET,
'site_network',
'0');
23 $session_handler = $GLOBALS[
'SQ_SYSTEM']->getSessionHandlerClassName();
25 if ($site_network_id) {
26 $site_network = &$GLOBALS[
'SQ_SYSTEM']->am->getAsset($site_network_id);
27 if (!is_null($site_network)) {
28 $primary_url = $site_network->getPrimaryURL();
31 if ($primary_url == sq_web_path(
'root_url')) {
35 if (isset($_GET[
'in_primary']) && $_GET[
'in_primary']) {
36 $_SESSION[
'SQ_SESSION_TIMESTAMP'] = time();
42 echo
'var SESSIONID = "'.session_id().
'";';
44 function start_session_handler(url) {
45 JsHttpConnector.submitRequest(url +
'&sessionid=' + SESSIONID);
51 if (!isset($_GET[
'sessionid']) || !preg_match(
'/^[a-z0-9]+$/i', $_GET[
'sessionid'])) {
53 trigger_localised_error(
'SYS0013', E_USER_ERROR);
55 if (is_null($site_network)) {
56 trigger_localised_error(
'SYS0014', E_USER_ERROR);
59 $session_handler_instance =
new $session_handler();
60 $session_handler_instance->syncSession($_GET[
'sessionid']);