0

when I try to fire several requests to my cakephp site at the same time I get this error:

session_regenerate_id(): Session object destruction failed [CORE\Cake\Model\Datasource\CakeSession.php, line 720]

I have no idea where that comes from. These warnings are crashing my ajax-calls. Same problem in cakephp versions 2.5.1 and 2.8.5!

Here is the code for the lines:

public static function renew() {
    if (session_id()) {
        if (session_id() || isset($_COOKIE[session_name()])) {
            setcookie(Configure::read('Session.cookie'), '', time() - 42000, self::$path);
        }
        session_regenerate_id(true);
    }
}

line 720 is the one with the session_regenerate_id-command.

I found this link but I don't get a "headers already sent"-error.

System: Windows Server 2012 R2 IIS 8 PHP v 5.6

Any ideas? I'm not very familiar with sessions to begin with.

Community
  • 1
  • 1
MrSmith
  • 370
  • 4
  • 22
  • Show us the ajax call you're making and the controller its arriving at – Colonel Mustard Aug 04 '16 at 16:47
  • It is not just one ajax call it's all of them. Happens when I fire more than one call at a time. – MrSmith Aug 05 '16 at 07:31
  • `I have no idea where that comes from` seems like an obvious race condition - there is a session id, but another request deletes the session before regenerating the session id. – AD7six Aug 05 '16 at 08:31
  • What can I do to avoid this? Should I stop the session from being regenerated? If so how do I do this? – MrSmith Aug 05 '16 at 12:48

0 Answers0