WC_Session_Handler::session_exists
Check if a session exists in the database.
Method of the class: WC_Session_Handler{}
No Hooks.
Returns
bool.
Usage
// private - for code of main (parent) class only $result = $this->session_exists( $customer_id );
- $customer_id(string) (required)
- Customer ID.
WC_Session_Handler::session_exists() WC Session Handler::session exists code WC 11.2.2
private function session_exists( $customer_id ) {
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- trusted table name.
return $customer_id && null !== $GLOBALS['wpdb']->get_var( $GLOBALS['wpdb']->prepare( "SELECT session_key FROM {$this->_table} WHERE session_key = %s", $customer_id ) );
}