You are here

public function SessionProxy_Backend_Base::start in Session Proxy 7

Start session.

Overrides SessionProxy_Backend_Interface::start

4 calls to SessionProxy_Backend_Base::start()
SessionProxy_Backend_Base::commit in lib/SessionProxy/Backend/Base.php
Called during shutdown hook time, this allows you to perform additional operations outside of the core PHP session handling at the end of request.
SessionProxy_Backend_Base::__construct in lib/SessionProxy/Backend/Base.php
Default constructor.
SessionProxy_Backend_Default::regenerate in lib/SessionProxy/Backend/Default.php
Regenerate the current session.
SessionProxy_Backend_Native::regenerate in lib/SessionProxy/Backend/Native.php
Regenerate the current session.

File

lib/SessionProxy/Backend/Base.php, line 130

Class

SessionProxy_Backend_Base

Code

public function start() {

  // Command line clients do not support cookies nor sessions.
  if (!$this->started && !drupal_is_cli()) {
    if (!$this
      ->sessionIsEmpty()) {

      // Keep data from already set data, even if the session has not been
      // started yet, some pieces of software may have set $_SESSION super
      // global data before us: this is an artifact of the lazzy session
      // creation feature.
      $currentData = $_SESSION;
      session_start();
      $_SESSION += $currentData;
    }
    else {
      session_start();
    }
    $this->started = TRUE;
  }
}