× How To / General

Joomla and Moodle sessions

4 months 2 weeks ago
Web Buster UK Ltd
Posts: 83
More
Topic Author
Joomla and Moodle sessions #1
This is an issue we can't seem to find a workaround for. The main point is that Joomla and Moodle keep track of separate sessions.

As a user logs into Joomla, they will also be logged into Moodle through Joomdle's SSO.

Unfortunately, even as they continue to work and remain signed in within Moodle, their Joomla session expires (when session lifetime is up) and they are logged out of Joomla. When they then return to Joomla, they find out that they are logged out.

Is there a way to keep Joomla and Moodle sessions synchronised? Or even just to prevent the user from being logged out of Joomla while they are working within Moodle?

Our websites currently uses Moodle in an iframe within Joomla. The snag is that when they are done with Moodle in the iframe and try clicking links outside of the iframe, it brings them to the login page (because Joomla session has expired).
4 months 2 weeks ago
Antonio Durán
Posts: 7039
More
Joomla and Moodle sessions #2
In theory, Joomdle updates Joomla sessions via Moodle cron...now, I have not tested this in quite a while so I am not 100% sure it is working.
I will test myself as soon as I can (I am away this week) and get back to you.
4 months 1 week ago
Antonio Durán
Posts: 7039
More
Joomla and Moodle sessions #3
Hi.

I took some time to check how this was working... and you are right: it is not working at all :(

I did some investigation, and it seems the old method we were using is not valid anymore, so I had to think of another way. Unfortunately, this new way is more complicated, but I have not been able to find a better solution.
You can check info on this new method here:
www.joomdle.com/wiki/Session_sync k

Please test and let us know if you have any issues.
4 months 1 week ago 4 months 1 week ago by Web Buster UK Ltd.
Web Buster UK Ltd
Posts: 83
More
Topic Author
Joomla and Moodle sessions #4
Thanks for the quick response. We'll test it with our students and report back if there's any issue.

Edit: on brief testing it doesn't seem to work. We are using Adaptable theme. Our steps:
  1. Created new folder theme/adaptable/javascript/
  2. Created new file in above folder called updatesession.js with our joomla URL
  3. Added the line in config.php
  4. Purged cache