PHP message: Cannot find session record "x" for user "X", creating new session

Re: PHP message: Cannot find session record "x" for user "X", creating new session

by Benjamin Seclier -
Number of replies: 0
Hello James and Job,
I had the same problem here (we are in moodle 2.6.8). This problem is due to this line in the /lib/classes/session/manager.php file :

ini_set('session.gc_maxlifetime', 60*60*24*4);

Indeed, this line forces the max session lifetime to 4 days. You have to replace it with this line :

ini_set('session.gc_maxlifetime', $CFG->sessiontimeout);

The $CFG->sessiontimeout is set in the admin panel (/admin/settings.php?section=sessionhandling).

With this patch, logs are gone smile
Hope it helped !

Regards,

Average of ratings: Useful (2)