• Resolved RealMag777

    (@realmag777)


    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.phphttps://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 condition if ( is_user_logged_in() && get_current_user_id() !== $this->_customer_id ) always work, and to stop it $this->_customer_id should be wrapped into intval($this->_customer_id) https://clip2net.com/s/41yoHep

    • This topic was modified 5 years, 10 months ago by RealMag777.
    • This topic was modified 5 years, 10 months ago by RealMag777.
    • This topic was modified 5 years, 10 months ago by RealMag777.
Viewing 1 replies (of 1 total)
  • Plugin Support Job a11n

    (@jobthomas)

    Automattic Happiness Engineer

    Hey @realmag777 – if you have a bug to report, you can do so at https://github.com/woocommerce/woocommerce – given that you also already have a solution for this, maybe try to create a pull request as well? That would make you a contributor to WooCommerce core.

    I’ll mark this as resolved since it’s not a support request.

Viewing 1 replies (of 1 total)
  • The topic ‘Report: If the user logs in, update session calls always’ is closed to new replies.