You are here

function session_cookie_lifetime_init in Session cookie lifetime 7

Implements hook_init().

Sets the session lifetime based on the module's setting. Saves the original session cookie lifetime.

File

./session_cookie_lifetime.module, line 89
Session configuration Drupal module.

Code

function session_cookie_lifetime_init() {
  $original_cookie_params = session_get_cookie_params();
  session_cookie_lifetime_set_original_lifetime($original_cookie_params['lifetime']);
  $cookie_lifetime = session_cookie_lifetime_get_lifetime();
  if ($cookie_lifetime !== NULL) {
    session_set_cookie_params($cookie_lifetime);
  }
}