function drupal_session_regenerate


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 drupal_session_regenerate()
cle7 drupal_session_regenerate()
elmsmedia7 drupal_session_regenerate()
icor7 drupal_session_regenerate()
meedjum_blog7 drupal_session_regenerate()
mooc7 drupal_session_regenerate()

Called when an anonymous user becomes authenticated or vice-versa.

Related topics

7 calls to drupal_session_regenerate()
bakery_user_authenticate_finalize in sites/all/modules/ulmus/bakery/bakery.module
Finalize the login process. Must be called when logging in a user.
devel_switch_user in sites/all/modules/ulmus/devel/devel.module
Switch from original user to another user and back. We don't call session_save_session() because we really want to change users. Usually unsafe!
masquerade_switch_back in sites/all/modules/ulmus/masquerade/masquerade.module
Function for a masquerading user to switch back to the previous user.
masquerade_switch_user in sites/all/modules/ulmus/masquerade/masquerade.module
Allows a user with the right permissions to become the selected user.
user_login_finalize in modules/user/user.module
Finalize the login process. Must be called when logging in a user.

... See full list


includes/, line 350
User session handling functions.


function drupal_session_regenerate() {
  global $user, $is_https;
  // Nothing to do if we are not allowed to change the session.
  if (!drupal_save_session()) {

  if ($is_https && variable_get('https', FALSE)) {
    $insecure_session_name = substr(session_name(), 1);
    if (!isset($GLOBALS['lazy_session']) && isset($_COOKIE[$insecure_session_name])) {
      $old_insecure_session_id = $_COOKIE[$insecure_session_name];
    $params = session_get_cookie_params();
    $session_id = drupal_random_key();
    // If a session cookie lifetime is set, the session will expire
    // $params['lifetime'] seconds from the current request. If it is not set,
    // it will expire when the browser is closed.
    $expire = $params['lifetime'] ? REQUEST_TIME + $params['lifetime'] : 0;
    setcookie($insecure_session_name, $session_id, $expire, $params['path'], $params['domain'], FALSE, $params['httponly']);
    $_COOKIE[$insecure_session_name] = $session_id;

  if (drupal_session_started()) {
    $old_session_id = session_id();

  if (isset($old_session_id)) {
    $params = session_get_cookie_params();
    $expire = $params['lifetime'] ? REQUEST_TIME + $params['lifetime'] : 0;
    setcookie(session_name(), session_id(), $expire, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
    $fields = array('sid' => session_id());
    if ($is_https) {
      $fields['ssid'] = session_id();
      // If the "secure pages" setting is enabled, use the newly-created
      // insecure session identifier as the regenerated sid.
      if (variable_get('https', FALSE)) {
        $fields['sid'] = $session_id;
    db_update('sessions')->fields($fields)->condition($is_https ? 'ssid' : 'sid', $old_session_id)->execute();
  elseif (isset($old_insecure_session_id)) {
    // If logging in to the secure site, and there was no active session on the
    // secure site but a session was active on the insecure site, update the
    // insecure session with the new session identifiers.
    db_update('sessions')->fields(array('sid' => $session_id, 'ssid' => session_id()))->condition('sid', $old_insecure_session_id)->execute();
  else {
    // Start the session when it doesn't exist yet.
    // Preserve the logged in user, as it will be reset to anonymous
    // by _drupal_session_read.
    $account = $user;
    $user = $account;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.