How To / General

Users not auto logged in to Moodle

  • torgrim
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago - 7 years 4 months ago #1 by torgrim
Users not auto logged in to Moodle was created by torgrim
User log in to Joomla ( www.mysite.com ), but when he later go to Moodle via link ( www.mysite.com/school ), he is not logged in/must log in once more?

How do I fix auto login from Joomla to Moodle?

System check: All green check-marks.

Moodle config file:
$CFG->wwwroot = ' www.mysite.com/school ';
$CFG->dataroot = '/home/webserverusername/moodledata';

Joomla Joomdle Config:
Connection method: cURL
Use redirect SSO: Yes
Use redirect logout: Yes
Moodle cookie path: /moodledata/sessions/ (blank at first tests, same error)
Last edit: 7 years 4 months ago by torgrim.

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic Users not auto logged in to Moodle
First: is the user you are testing with a Joomdle user? ie: he shows the 3 checks in Joomdle->Users page.

Try disabling redirectless SSO and see if it works that way.

Please Log in or Create an account to join the conversation.

  • torgrim
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #3 by torgrim
Replied by torgrim on topic Users not auto logged in to Moodle
Thanks Antonio.
Yes, the user is a Joomdle user (Joomla, Moodle and Joomdle user). Did a manual sync/update in Joomla backend to add him.

Turning off the "Use redirectless SSO" and "Use redirectless logout" worked! (Moodle Cookie Path = "/", Connection method = cURL).

Now user can log in to Joomla, go to mysite.com/school, and he is logged in. If he log out of Moodle, and then go back to Joomla, he is logged out. If he go directly to Moodle (mysite.com/school) and log in first here, then go to Joomla, he is logged in. This is fantastic!!

Definitively will purchase full Joomdle next week! I am so glad I by pure luck found your solution.

Thank you again! Have a nice week! :)

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #4 by Antonio Durán
Replied by Antonio Durán on topic Users not auto logged in to Moodle
Great to know it is working, and that you are liking Joomdle :)

Using SSO with redirect will work most of the time, and that's why it comes as default option. If you ever need to make redirect-less work, just let us know and we'll try to help.

Please Log in or Create an account to join the conversation.

  • torgrim
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago - 7 years 4 months ago #5 by torgrim
Replied by torgrim on topic Users not auto logged in to Moodle
Thanks, BTW, I got it working with "Use redirectless SSO".
Turned out I had the wrong Moodle cookie path (mine was "/").

Going to Moodle: System administration > Server > Session handling, the correct system Moodle cookie path is found in the "Cookie path" field. (mine was "/school/").
Just copy-pasted this to Joomla: Components > Joomdle > Configuration - [Moodle cookie path] field, and now it works wonders! :)
Last edit: 7 years 4 months ago by torgrim.

Please Log in or Create an account to join the conversation.

  • torgrim
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #6 by torgrim
Replied by torgrim on topic Users not auto logged in to Moodle
No, sorry, it does not work.
Reason it worked yesterday is probably because of cache (been logged in to Moodle, logout, login to Joomla, now it works. Does not work if user only logs into Joomla, and then go to mysite.com/school).

When I log in to Joomla (EasySocial) today, and then go to mysite.com/school, user is not logged in.
Strange thing is that if I on other computer log in to Moodle (mysite.com/school) as administrator, I can see in the module "Users online" that both me (admin) and the user I tested a minute earlier on, both have been online the last 5 minutes...

Strange...

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #7 by Antonio Durán
Replied by Antonio Durán on topic Users not auto logged in to Moodle
But does it work with redirect-less SSO turned off? As I said, it's easier to get this config to work than redirect-less one.
Also it is better to get SSO working with redirect, and then try redirect-less if needed.

Please Log in or Create an account to join the conversation.

  • torgrim
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 4 months ago #8 by torgrim
Replied by torgrim on topic Users not auto logged in to Moodle
Turned off redirectless SSO/logout, and now it seems to work again. Will test on new computers later today.

Please Log in or Create an account to join the conversation.