User logout on browser / tab close How to modify Drupal user's cookie so the cookie is not available anymore after a predefined time or when the user close his web browser or close all of the websites pages open in tabs ?

After some online searches i found that by setting the cookie lifetime to 0 should create temporary cookies that would be deleted once the browser is closed:

I first tried by modifing some ini_set() values in the settings.php :

ini_set('session.cookie_lifetime',  0);
ini_set('session.gc_maxlifetime',   0);


I created a php.ini file located at the drupal site root, containing:

session.cookie_lifetime = 0;


But it does not work on my test site. Any ideas?
You can change this setting directly in the settings.php. You've a line that looks like that : 

ini_set('session.cookie_lifetime', 2000000);

Change 2000000 to 0 and you will get what you want.