WordPress at Your Fingertips
function is not described

WC_Session_Handler::cleanup_sessions() public WC 1.0

Cleanup session data from the database and clear caches.

{} It's a method of the class: WC_Session_Handler{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Session_Handler = new WC_Session_Handler();
$WC_Session_Handler->cleanup_sessions();

Code of WC_Session_Handler::cleanup_sessions() WC 5.9.0

public function cleanup_sessions() {
	global $wpdb;

	$wpdb->query( $wpdb->prepare( "DELETE FROM $this->_table WHERE session_expiry < %d", time() ) ); // @codingStandardsIgnoreLine.

	if ( class_exists( 'WC_Cache_Helper' ) ) {
		WC_Cache_Helper::invalidate_cache_group( WC_SESSION_CACHE_GROUP );
	}
}