I am trying to implement persistent customer login, by that I mean to add a checkbox of remember me and if checked the customer will stay logged in longer then if he would not check the remember checkbox.

Magento 2 offers a persistent shopping cart which only persists the customer's cart but does not keep the customer itself logged in.

I tried to override vendor/magento/framework/Session/Config.php and set cookie lifetime by the $_POST contents (if the customer checked remember) and inject a new cookie with the desired long login period.

It looks really clumsy, is there a better way to implement this functionality?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.