Fatal Error: init_session_cookie throws error
-
Hi,
when I’m trying to register a new user from the accounts page, the following error gets thrown:Fatal error: Uncaught ArgumentCountError: Too few arguments to function CoCart_Session_Handler::init_session_cookie(), 0 passed in /Users/rene/Local Sites/clonck-demo/app/public/wp-content/plugins/woocommerce/includes/wc-user-functions.php on line 224 and exactly 1 expected in /Users/rene/Local Sites/clonck-demo/app/public/wp-content/plugins/cart-rest-api-for-woocommerce/includes/class-cocart-session-handler.php on line 106
( ! ) ArgumentCountError: Too few arguments to function CoCart_Session_Handler::init_session_cookie(), 0 passed in /Users/rene/Local Sites/clonck-demo/app/public/wp-content/plugins/woocommerce/includes/wc-user-functions.php on line 224 and exactly 1 expected in /Users/rene/Local Sites/clonck-demo/app/public/wp-content/plugins/cart-rest-api-for-woocommerce/includes/class-cocart-session-handler.php on line 106
I think it is because no parameter is given to the init_session_cookie() function:
function wc_set_customer_auth_cookie( $customer_id ) {
wp_set_current_user( $customer_id );
wp_set_auth_cookie( $customer_id, true );// Update session.
WC()->session->init_session_cookie();
}When I reload the page afterwards, the user is logged in and the error is gone.
- The topic ‘Fatal Error: init_session_cookie throws error’ is closed to new replies.