Index: user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user.module,v retrieving revision 1.441 diff -u -r1.441 user.module --- user.module 12 Feb 2005 07:51:14 -0000 1.441 +++ user.module 13 Feb 2005 18:36:21 -0000 @@ -788,6 +788,27 @@ user_module_invoke('login', $edit, $user); + // Get the path to set the cookie for + $path = preg_replace("/.+\/\/[^\/]+(.*)/", "\$1/", $base_url); + // Find out how long we should keep the cookie session for + // + // You can override the default (1 month) by putting the following + // in the settings.php file, under the $conf variable + // 'user_session_lifetime' => 2592000, + // + // You can set it to any value, here are the most likely ones + // 86400 : 1 day + // 172800 : 2 days + // 604800 : 1 week + // 1209600 : 2 weeks + // 2592000 : 1 month + // 7776000 : 3 months + // 15552000 : 6 months + + $session_lifetime = variable_get('user_session_lifetime', 2592000); + // Set the cookie + setcookie(session_name(), session_id(), time() + $session_lifetime, $path); + // Redirect the user to the page he logged on from. drupal_goto(); }