Magento uses the cookie lifetime configuration to set how long the customer will be able to stay logged in.
If the value is set to 0, on browser close, the cookie gets removed and reopening the browser , the customer would be logged out.
I am creating a custom checkbox during login, on clicking which I want to implement the same functionality.
When user does not check the checkbox, regardless of the store config value, the cookie lifetime should be 0. So when browser is re opened , the customer would be logged out.
I found persistent shopping cart provides a similar checkbox, but I am unsure if the required functionality is achieved there.
Is there any existing way this can be achieved? Otherwise what would be the ideal process to do so.