Report: If the user logs in, update session calls always
-
Hello
I admitted that for logged-in user always call
public function init_session_cookie()
in class WC_Session_Handler, file wp-content\plugins\woocommerce\includes\class-wc-session-handler.php – https://clip2net.com/s/41yoozL and MySQL query ‘INSERT INTO pn_woocommerce_sessions’. This is not logically right, so I checked the code and found the reason here: https://clip2net.com/s/41yoy1f –$this->_customer_id
is string there and because of it conditionif ( is_user_logged_in() && get_current_user_id() !== $this->_customer_id )
always work, and to stop it$this->_customer_id
should be wrapped intointval($this->_customer_id)
https://clip2net.com/s/41yoHep
- The topic ‘Report: If the user logs in, update session calls always’ is closed to new replies.