Merge pull request #21991 from johnbillion/21989/user-switching-support

User Switching support
This commit is contained in:
Mike Jolley 2019-01-09 17:01:47 +00:00 committed by GitHub
commit bf5ea249b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -231,9 +231,15 @@ class WC_Session_Handler extends WC_Session {
* Destroy all session data.
*/
public function destroy_session() {
wc_setcookie( $this->_cookie, '', time() - YEAR_IN_SECONDS, apply_filters( 'wc_session_use_secure_cookie', false ) );
$this->delete_session( $this->_customer_id );
$this->forget_session();
}
/**
* Forget all session data without destroying it.
*/
public function forget_session() {
wc_setcookie( $this->_cookie, '', time() - YEAR_IN_SECONDS, apply_filters( 'wc_session_use_secure_cookie', false ) );
wc_empty_cart();