By goldschmidt.a on
Hi,
I'd like my users to be automatically logged out when they close their browsers (in case they forget to click the 'logout' link). I've been trying lots of fixes suggested for Drupal 4.7 (http://drupal.org/node/38073), but nothing seems to work. These suggestions point me towards making the session's cookie have a lifetime of 0, which I've tried setting in sites->default->settings.php and .htaccess as instructed here: http://drupal.org/node/25852#comment-44770.
Here's the cookies part of my settings.php file:
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', 200000);
ini_set('session.save_handler', 'user');
ini_set('session.use_only_cookies', 0);
ini_set('session.use_trans_sid', 0);
ini_set('url_rewriter.tags', '');
I'm hosting with GoDaddy, using PHP 5.2.5, and MySQL 4.1.22, and Drupal 6.
Thanks,
Andrew G
Comments
Persistent Login module
Use the Persistent Login module - http://drupal.org/project/persistent_login
still meet the same problems
still meet the same problems with persistent_login module. It does not work with Firefox.
----------------------------------
http://learnvietnam.com/ Bring Vietnam to the World
any progress
any progress on this issue (elsewhere in the forums) cos i want to force logout of D6 too if the browser is closed?
these settings seem to work
these settings seem to work for me on PC browsers, though still not sure what the issue is on Mac browsers. on Windows browsers (IE, FF/win, etc.), users are logged out when they close the browser. still not working on Mac browsers (Safari, FF/mac, etc.):
in sites/default/settings.php
be sure you are definitely overwriting the settings.php file in there. sometimes i replace the file using my FTP client and the file isn't actually replaced because of permissions settings on the folder itself.
check your .htaccess file too. i think that has something to do with it.
hope that helps lead you in the right direction,
good luck,
Andrew G