Ad
Log Out All Customers From Prestashop
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.
Ad
Answer
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.
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
Ad