Is it possible to force a log-off from the user's account when he/she exits the browser? Many browser-based applications support this. I think this would be good from a security standpoint.

If so, how do I configure this?

Thanks in advance.

Comments

yelvington’s picture

Your settings.php file should have a line like this:

ini_set('session.cookie_lifetime', 2000000);

PHP docs say:

session.cookie_lifetime integer

session.cookie_lifetime specifies the lifetime of the cookie in seconds which is sent to the browser. The value 0 means "until the browser is closed."

mjohnq3’s picture

Thank you. Setting that value to 0 now logs the user out.

geme4472’s picture

but I'm not getting logged out when I close a browser window. Drupal 4.6 and very clean install.

ini_set('arg_separator.output',     '&');
ini_set('magic_quotes_runtime',     0);
ini_set('magic_quotes_sybase',      0);
ini_set('session.cache_expire',     200000);
ini_set('session.cache_limiter',    'none');
ini_set('session.cookie_lifetime',  0);
ini_set('session.gc_maxlifetime',   0);
ini_set('session.save_handler',     'user');
ini_set('session.use_only_cookies', 1);
ini_set('session.use_trans_sid',    0);

And ideas??? Thanks.

ciscokid’s picture

Did you sort this, I had same problem but cleared cookies in Explorer and it works.

geme4472’s picture

I simply hadn't cleared IE's cookies. All is well.

truyenle’s picture

It work for me too, remember to clear the cookies.

Truyenle