woocommerce_session_handler, WC_Session_Handler

woocommerce_session_handler, WC_Session_Handler

Appears in:
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.11.0.0

apply_filters('woocommerce_session_handler, WC_Session_Handler') is found 2 times:

  • /includes/class-woocommerce.php line 1240
    	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 2413
     * @since 3.3.0
     * @return void
     */
    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();
    	}
    }