woocommerce_session_handler

woocommerce_session_handler

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_session_handler') is found 2 times:

  • /includes/class-woocommerce.php line 956
    	public function initialize_session() {
    		/**
    		 * Filter to overwrite the session class that handles session data for users.
    		 */
    		$session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingSinceComment
    		if ( is_null( $this->session ) || ! $this->session instanceof $session_class ) {
    			$this->session = new $session_class();
    			$this->session->init();
    		}
    	}
    
    
  • /includes/wc-core-functions.php line 2405
     *
     * @since 3.3.0
     */
    function wc_cleanup_session_data() {
    	$session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' );
    	$session       = new $session_class();
    
    	if ( is_callable( array( $session, 'cleanup_sessions' ) ) ) {
    		$session->cleanup_sessions();
    	}
    }