function drupal_session_start

7.x drupal_session_start()

Starts a session forcefully, preserving already set session data.

Related topics

4 calls to drupal_session_start()
drupal_session_commit in drupal/includes/
Commits the current session, if necessary.
drupal_session_initialize in drupal/includes/
Initializes the session handler, starting a session if needed.
drupal_session_regenerate in drupal/includes/
Called when an anonymous user becomes authenticated or vice-versa.
update.php in drupal/update.php
Administrative page for handling updates from one Drupal version to another.


drupal/includes/, line 281
User session handling functions.


function drupal_session_start() {
  // Command line clients do not support cookies nor sessions.
  if (!drupal_session_started() && !drupal_is_cli()) {
    // Save current session data before starting it, as PHP will destroy it.
    $session_data = isset($_SESSION) ? $_SESSION : NULL;


    // Restore session data.
    if (!empty($session_data)) {
      $_SESSION += $session_data;