Error code: invalidsesskey

Error code: invalidsesskey

by Francis Vendrell -
Number of replies: 2

Hello,

I am facing a weird problem with Moodle 3.3.5 when new accounts are created on the page login/signup.php

The error message is :

Your session has most likely timed out. Please log in again.

More information about this error

Debug info: 

Error code: invalidsesskey

Stack trace:

line 503 of /lib/setuplib.php: moodle_exception thrown

line 305 of /lib/formslib.php: call to print_error()

line 218 of /lib/formslib.php: call to moodleform->_process_submission()

line 310 of /lib/authlib.php: call to moodleform->__construct()

line 89 of /login/signup.php: call to auth_plugin_base->signup_form()


The problem appeared suddenly and apparently with no particular evident reason. Then it disappeared spontaneously before reappearing again and so on several times during the last seven days. Clearing the caches didn't solve it. thoughtful

I would appreciate your help as this problem has a negative impact on my business... black eye

Average of ratings: -
In reply to Francis Vendrell

Re: Error code: invalidsesskey

by Colin Fraser -

Straight from the Moodle Docs on this error...

The most likely reason for obtaining an "Invalid Sesskey" message is because your session has timed out i.e. you were inactive for an extended period. Please log in again.

Other possible reasons are:

  1. Your site doesn't have the PHP setting "session.auto_start=0" (see Installing Moodle - software)
  2. You logged out at some time between opening the form and submitting it.
  3. You have followed a bad link to a form script.
  4. Your database has an incorrect value for sessioncookiepath in the mdl_config table.
  5. You edited the code in a file on the server while logged in to your moodle website.
If any of these are the cause of your problem, then perhaps some re-education is required.... If this is a frequent occurrence, I'd start with checking the sessioncookiepath. 

 

Average of ratings: Useful (1)
In reply to Colin Fraser

Re: Error code: invalidsesskey

by Francis Vendrell -

Thank you Colin form your message.

It seems that the problem was related to a corrupted file (/login/signup.php), because by uploading it to the server again, the problem disappeared and has not reappeared since...

Corrupt files make life difficult...