I need a way to log out all signed in customers from my Prestashop site, as a domain name migration caused some issues with user sessions, and having customers sign out and re-sign in is fixing it.
I tried the following code, to no avail:
$customers = Customer::getCustomers();
foreach($customers as $customer) {
$obj = new Customer($customer['id_customer']);
$obj->logout();
}
Is there a way to natively invalidate/destroy all user sessions from Prestashop (code or back office)? Otherwise, plain PHP methods are more than welcome.
You have to change the Prestashop cookie to avoid validating login.
It's impossible to change the "cookey-key" because of failing all passwords but you can override Cookie class and change cookie pattern.
Yes, overriding the Cookie.php class was the way to go, thank you! I added more details in my answer for those interested.