Beaker has asked for the wisdom of the Perl Monks concerning the following question:

If a user thinks their password has been compromised, they may wish to log out from all devices. Therefore I wish to find all sessions matching the username param and delete them.
my $session = CGI::Session->load("driver:File", $session_id, {Dire +ctory=>$datadir.'/members/sessions'}); if ($session) { $session->delete(); $session->flush(); }
How would I modify this code to complete the task?

Replies are listed 'Best First'.
Re: Delete sessions by parameter using CGI::Session
by poj (Abbot) on Mar 08, 2019 at 08:38 UTC
      thank you, got it working now from this.