Invalid Login token error after upgraded to 3.11

Invalid Login token error after upgraded to 3.11

by Shyson Thomas -
Number of replies: 3

I am getting Invalid Login token error for the login request after upgrading to moodle 3.11 from 3.8


I tried with $CFG->disablelogintoken = true; , but then getting error "Unfortunately, cookies are currently not enabled in your browser"

I have added $CFG->usesid=true; after getting the cookies error, but no change.

$CFG->sslproxy = true;

$CFG->dboptions = array(

    'dbpersist' => false,

    'dbsocket'  => false,

    'dbport'    => '',

    'dbhandlesoptions' => false,

    'dbcollation' => 'utf8_general_ci'

);

$CFG->dbtype    = 'mysqli';

$CFG->dblibrary = 'native';

are already present.

My application is on AWS cloud and we have a clodfront cache before the server. If I am using non-cloudfront url, I am able to login successfully.


What could be the issue?

Average of ratings: -
In reply to Shyson Thomas

Re: Invalid Login token error after upgraded to 3.11

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

My application is on AWS cloud and we have a clodfront cache before the server. If I am using non-cloudfront url, I am able to login successfully. – Haven't you answered your own question? Try disabling the CloudFront cache. There are a few posts here where Cloudflare caching was breaking Moodle. Such caching is fine with largely static pages but with Moodle it causes out-of-date files to get sent to the browser that the web server hasn't sent (because they've come from the cache). Moodle does a lot of internal caching for performance (which can be tuned further as needed), but caching between the Moodle web server and the browser will likely cause problems.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Invalid Login token error after upgraded to 3.11

by Shyson Thomas -
Thanks for the quick response.

This was working fine with cloud front url till the upgrade. So I was wondering if there is any addition config settings required to make it work on V3.11.

I need to discuss with business if I can avoid cloud front caching, but definitely I have to provide justification how it was working before the upgrade.
In reply to Shyson Thomas

Re: Invalid Login token error after upgraded to 3.11

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

I can't advise on that. In general I wouldn't expect Moodle to work correctly with caching in front of the web server. Maybe someone here has experience of both CloudFront and the changes between Moodle versions that can help. Otherwise you'd need to set up a Moodle 3.8 site and look at what's different in requests and responses via the cache, and the requests that get through to the web server and how they're processed.