Session sync

From Joomdle
Jump to: navigation, search

Joomdle provides ways to keep session alive in one platform when working on the other one. This allows the user to work on one side, and get back the the other one later without having to log in again.

This funcionality is disabled by default, as it may impact sites perfomance.

Joomla

In Joomla, you can enable Joomdlesession plugin. This plugin will call a web service in Moodle to update session on every Joomla page load.


Moodle

In Moodle procedure is more complicated:

  • Find folder for the theme you are using, in /moodle/themes
  • Check if it has a javascript/ folder inside. If not, create it.
  • Create inside javascript/ folder a file called updatesession.js with this code, changing your Joomla URL in it first:
window.onload = function() {
    var url = 'http://YOUR_JOOMLA_URL';
    var xhttp = new XMLHttpRequest();
    xhttp.open('get', url, true);
    xhttp.send();

    }
  • Open /moodle/themes/YOUR_THEME/config.php and add at the end:
$THEME->javascripts[] = 'updatesession';
  • Finally you will need to purge javascript and theme caches in Moodle->Site administration->Development->Purge caches