User logout automatically when the browser is closed I need to logout a user if the browser is closed. I'm using Drupal 8.
I tried setting a session cookie in php. But the problem is the cookie should be 'httponly' and 'secure'.

Please suggest me the right method or is Drupal having such settings to achieve  this.

Thanks.
Okay, I changed the cookie_lifetime: 2000000 to 0 in local.services.yml file.

Then set the cookie in php by giving the last 2 arguments as 'true' ,this makes the cookie to be httponly and secure.

Thanks for your reference.