Skip to content

Commit

Permalink
login_processing.php: save the SmrSession sooner
Browse files Browse the repository at this point in the history
There was a lot of other processing between when the SmrSession
was created during login and when it was actually saved to the
database. The longer this time interval, the greater the opportunity
for a race condition.

Save the SmrSession as soon as possible (immediately after it is
updated with the account_id and the next page SN. This is not
expected to fix the problem, but may reduce its frequency.

See #635 for more detail.
  • Loading branch information
hemberger committed Jan 16, 2019
1 parent a2aa3f0 commit 55e9c2e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions htdocs/login_processing.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
}
}

// this sn identifies our container later
$href = SmrSession::getNewHREF(create_container('login_check_processing.php'), true);
SmrSession::update();

// ********************************
// *
// * G a m e O p e n
Expand Down Expand Up @@ -197,9 +201,6 @@

}

// this sn identifies our container later
$href = SmrSession::getNewHREF(create_container('login_check_processing.php'), true);
SmrSession::update();
//get rid of expired messages
$db2->query('UPDATE message SET receiver_delete = \'TRUE\', sender_delete = \'TRUE\', expire_time = 0 WHERE expire_time < '.$db->escapeNumber(TIME).' AND expire_time != 0');
// Mark message as read if it was sent to self as a mass mail.
Expand Down

0 comments on commit 55e9c2e

Please sign in to comment.