Skip to content

Commit

Permalink
MDL-17477 improve session purging when deleting users
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Aug 5, 2011
1 parent 3fdc622 commit f9fd10e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/moodlelib.php
Expand Up @@ -3509,6 +3509,9 @@ function delete_user($user) {
// last course access not necessary either
$DB->delete_records('user_lastaccess', array('userid'=>$user->id));

// force logout - may fail if file based sessions used, sorry
session_kill_user($user->id);

// now do a final accesslib cleanup - removes all role assignments in user context and context itself
delete_context(CONTEXT_USER, $user->id);

Expand Down

0 comments on commit f9fd10e

Please sign in to comment.