Skip to content
Snippets Groups Projects
Commit 6decf897 authored by Giovannoni Laurent's avatar Giovannoni Laurent
Browse files

FEAT #4618 enable jlnp with client cookies

parent 54fdc0ed
No related branches found
No related tags found
No related merge requests found
......@@ -217,7 +217,55 @@ $time = $core->get_session_time_expire();
echo $_SESSION['config']['businessappurl'];
?>index.php?display=true&page=logout&logout=true');" id="maarch_body">
<?php
<?php
//do it only once
if (empty($_SESSION['clientSideCookies'])) {
?>
<script type="text/javascript">
function getCookies() {
//document.cookie = "maarch_cookie_1=thefirstcookie";
//document.cookie = "maarch_cookie_2=thesecondcookie";
//console.log(document.cookie);
return document.cookie;
};
var theCookies;
//theCookies = getCookies().split(";");
theCookies = getCookies();
if (theCookies != undefined) {
//console.log('The cookies...');
//console.log(theCookies);
var path_manage_script = '<?php echo $_SESSION["config"]["businessappurl"];?>' + 'index.php?display=true&page=setProxyCookies';
new Ajax.Request(path_manage_script,
{
method:'post',
parameters: {
cookies : theCookies
},
onSuccess: function(answer)
{
eval('response = ' + answer.responseText);
//console.log(response);
if (response.status == '0') {
//console.log('OK !!! COOKIES FROM PROXY SET');
} else {
//console.log('KO... COOKIES FROM PROXY NOT SET');
}
}
});
} else {
//console.log('no completements cookies');
}
</script>
<?php
}
if (!isset($_REQUEST['display'])) { ?>
<script>
var element = document;
......
<?php
/*
* Copyright 2008-2016 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
if (!empty($_REQUEST['cookies'])) {
$_SESSION['clientSideCookies'] = $_REQUEST['cookies'];
echo "{status : '0'}";
} else {
$_SESSION['clientSideCookies'] = false;
echo "{status : '1'}";
}
exit;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment