× R0.22 and earlier

PHP Session handling

9 years 5 months ago
Chris
Posts: 2118
More
Topic Author
PHP Session handling #1
I wonder if there is "more" we can say, in the documentation, about the issue of PHP session handling in Moodle to help ppl find their way.

Given that rewriting urls is common in Joomla i.e. rewriting mydomain.com to www.mydomain.com k, I think a number of ppl will experience the total lockout from Moodle. In fact, silly me just did it on Sunday while testing as I was testing R0.23. It didn't occur to me that I would be locked out from Moodle's admin too and took me a little while (embarrassingly a long while) to realise this was the issue. I tried changing Moodle passwords and user ids from phpadmin, tried changing networking, password and other policies as well. In the end I went to sleep woke up and recalled the PHP session comment you made - which I only read because I was doing the documentation over the weekend. 10 seconds later, adjusted .htaccess and I was back in action!

I wonder how many others will eventually experience this and not know what to do aside from changing their .htaccess back not rewrite. I will look through Moodle to see if there is a back-door way to "fix" this. I searched through moodle.org and couldn't see anything off hand and also looked through all the moodle settings and came up with blanks. So I wonder, if there is something we can do from the browser side, like clearing a cache, cookie or some other thing ??
9 years 5 months ago
Antonio Durán
Posts: 6957
More
PHP Session handling #2
Hi. I don't think we can du much here, as this is the way sessions are supposed to work.
Different domains have different sessions.

Aside from poiniting it out in the documentation, I am not sure we can do anything about this.

On a related note, yesterday I spent all day working with session syncing, and it seems it is working now. Will tell you more when it is finished.
9 years 5 months ago
Chris
Posts: 2118
More
Topic Author
PHP Session handling #3
Yeah, didn't think we could "do much". Was just wondering if we could provide some steps on what to do should someone experience this. For me, I removed mod_rewrite from my .htaccess - which affects Joomla. Ie. I rewrote mydomain.com to www.mydomain.com k and once I had the problem I removed so that there is no re-writing.

I will put it back in once I figure out what to do about Moodle. For example, change the Moodle's configuration to match somewhere such that Moodle understand that we should be using www. I can imagine that if, when I installed Moodle, if I specified www.mydomain.com/moodle/install k instead of mydomain.com/moodle/install then it would be OK?? Or before moodle was installed I had mod_rewrite already setup ... etc. stuff like this.

So, this is not so much a development issue more can we make our FAQ a little more helpful for this type of situation.