could we delete an old record manually?? because in will be very large db if we not delete it and sure it will affect the site performance...!

Comments

imunklovarian created an issue. See original summary.

greggles’s picture

Title: How to delete old record manually » Provide documentation and perhaps tools to delete old records
Version: 7.x-1.0 » 7.x-1.x-dev

Is it the login_history table or the lhfingerprintjs2 table that presents an issue for you?

astonvictor’s picture

There is no possibility to clear data from UI.

You can implement hook_cron():

/**
 * Implements hook_cron().
 */
function MODULE_cron() {
  $num_deleted = db_delete('login_history')
    ->execute();
}

The example above removes all data from login_history table.
+ you can add a condition by time
->condition('login', strtotime('-1 week'), '<')
So, you can remove only old data.

benjamin_dk’s picture

Since many of us are required to comply with the GDPR legislation where users have "the right to be forgotten", it is a good idea to provide an admin page with a select option to delete entries that are more than e.g. x months old, and maybe even an option for deleting all login history for a given user.

The pruning of the table could take place when cron is run.

greggles’s picture

Issue tags: +GDPR

Good point. Adding a GDPR tag to this to help raise that visibility.