Moodle session lost after page reload

Moodle session lost after page reload

by Zvonko Martinović -
Number of replies: 5

Hi,

after we upgraded Moodle from 3.3.1 to 3.5.1 we started to experience one very unusual problem. When we reload a page in Firefox, Opera or IE/Edge we lose Moodle session. If happens no matter if we are logged in or just access front page and try to reload it. If we browse Moodle using links everything works just fine. Even hitting Enter key in URL bar reloads OK, but hitting F5 or reload button in the toolbar problem appears. Funny thing is that everything works great in Chrome and sometimes in other browsers also, but most of the time Firefox/Opera/IE/Edge show the problem. 

We use PHP 7.1 (via Apache handler), Apache 2.4, PostgreSQL on CentOS 7.

Did anyone ever experienced similar problem and managed to resolve it because this makes no seance to me?

Thanks,
Zvonko

Average of ratings: -
In reply to Zvonko Martinović

Re: Moodle session lost after page reload

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Firstly, run Moodle with the JavaScript console open in the browser and check for any errors. 

Check your web server's error log for any errors.

Have you any non-core themes or plugins? Especially any obscure/unusual ones. 

In reply to Howard Miller

Re: Moodle session lost after page reload

by Zvonko Martinović -

Hi Howard,

there are no JavaScript errors or any server side errors. We do have a number of extra plugins, some are from Moodle.org and some are our own custom plugins plus our own custom theme. But we have several Moodle installations all using same theme and majority of plugins and only on this one we have problem. We also have a development server with the same exact code (all plugins and configs) as this one, and it all works OK there.

I made two short screen videos where you can see the problem:

1. Using Firefox - http://mojoblak.srce.hr/public.php?service=files&t=0a27ae25a856b17fb5349e0fb1431065

You can see that sessions is lost but only if I hit refresh button, even on front page before login. If i reload the page from the address bar or just use Moodle via links, it all works OK. But when I reload there is the problem

2. Using Chrome - http://mojoblak.srce.hr/public.php?service=files&t=bf9c304ad99b3c114c2c1e5deebd88ec

You can see that everything works as expected in Chrome, no problems there.

The most bizarre thing is that sometimes it all works fine in Firefox also. There can be a period of 1-2 hours when everything is just fine. It's not predictable, but happens randomly. Btw it's not a problem on my PC as we tested on different machines using different OS with the same results.


If there are any insights, I'm more then happy to hear/try anything new :D


Thanks,
Zvonko

In reply to Zvonko Martinović

Re: Moodle session lost after page reload

by Conn Warwicker -
Picture of Core developers Picture of Plugin developers

Sounds like a strange one.

Do you have any kind of NTLM/Single-SIgnon enabled in any browsers, which might be messing up?


In reply to Conn Warwicker

Re: Moodle session lost after page reload

by Zvonko Martinović -

Nope, same problem is also on outer network. Even tried on mobile (Android) Chrome/Firefox. Same thing, Firefox has problems and Chrome works fine.

Crazy, I know haha

In reply to Zvonko Martinović

Re: Moodle session lost after page reload

by deva m -
Hi Zvonko,
Did you managed to solve this issue ?
I too face this problem in my site...