woocommerce_session_handler

woocommerce_session_handler

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

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_session_handler') is found 2 times:

  • /includes/class-woocommerce.php line 1063
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    1067
    1068
    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 2537
    2533
    2534
    2535
    2536
    2537
    2538
    2539
    2540
    2541
    2542
    2543
    *
     * @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();
        }
    }