$cust_username = $dbh->selectrow_array(qq{SELECT username FROM users WHERE id = "$in{id}"}); $sth1 = $dbh->prepare (qq{ SELECT * FROM session_db }); $sth1->execute(); while($row1 = $sth1->fetchrow_hashref()) { next if !$row1->{id}; $sess_ref1 = CWT::Site_DB->open_with_expiration(undef, $row1->{id}); if($sess_ref1->attr("username") eq "$cust_username") { if ($sess_ref1->attr("is_admin") == 1) { $sess_ref1->clear_attr("is_admin"); # Delete that variable from sess. } else { next; } } else { next; } } $sth1->finish();