A required parameter (sesskey) was missing

A required parameter (sesskey) was missing

by Colin Cruikshank -
Number of replies: 1

Hello.

I am able to trigger this error "A required parameter (sesskey) was missing" by doing the following:

Sign in, and view a course scorm module. The page would be http://xxxxx/mod/scorm/player.php

While on this page, log out. You will be sent to the signup form. Immediately log back in. The error will trigger. Below is the call stack.

C:\Users\Documents\Repos\moodle\lib\setuplib.php:497 ()
C:\Users\Documents\Repos\moodle\lib\moodlelib.php:566 print_error()
C:\Users\Documents\Repos\moodle\lib\sessionlib.php:73 required_param()
C:\Users\Documents\Repos\moodle\mod\scorm\datamodel.php:53 confirm_sesskey()


Confirm_sesskey() checks for the sesskey using required_param(), and required_param checks the $_POST / $_GET arrays for the key. If it doesn't exist, it throws an exception. When you log back in, the page will redirect you to the scorm player, which throws the error because as far as I know POST data is lost during a redirect and therefore required_param fails.

Anyone run into this problem? ideas on how to fix this without fiddling in moodle core code?

Average of ratings: -
In reply to Colin Cruikshank

Re: A required parameter (sesskey) was missing

by Colin Cruikshank -
The only way I could think of to get around the problem was to put:

$SESSION->wantsurl = null;

into our auth plugin so that no matter what when a user logs in they land on the dashboard. Not ideal, but I can't have it throwing exceptions when it tries to redirect to a page with a required_param call.