File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 9
9
10
10
class CustomerLogout implements ObserverInterface
11
11
{
12
+ public const UNSET_AUTHENTICATION_USER_TOKEN_COOKIE_NAME = "unset_authentication_token " ;
12
13
/**
13
14
* @var PhpCookieManager
14
15
*/
@@ -42,9 +43,15 @@ public function __construct(
42
43
public function execute (\Magento \Framework \Event \Observer $ observer )
43
44
{
44
45
if ($ this ->cookieManager ->getCookie (InsightsHelper::ALGOLIA_CUSTOMER_USER_TOKEN_COOKIE_NAME )) {
46
+ $ metaDataUnset = $ this ->cookieMetadataFactory ->createPublicCookieMetadata ()
47
+ ->setDurationOneYear ()
48
+ ->setPath ('/ ' )
49
+ ->setHttpOnly (false )
50
+ ->setSecure (false );
51
+ $ this ->cookieManager ->setPublicCookie (self ::UNSET_AUTHENTICATION_USER_TOKEN_COOKIE_NAME , 1 , $ metaDataUnset );
45
52
$ metadata = $ this ->cookieMetadataFactory ->createCookieMetadata ();
46
53
$ metadata ->setPath ('/ ' );
47
54
$ this ->cookieManager ->deleteCookie (InsightsHelper::ALGOLIA_CUSTOMER_USER_TOKEN_COOKIE_NAME , $ metadata );
48
55
}
49
56
}
50
- }
57
+ }
You can’t perform that action at this time.
0 commit comments