function drupal_session_start in Memcache Storage 7
Forcefully starts a session, preserving already set session data.
3 calls to drupal_session_start()
- drupal_session_commit in includes/
session.inc - Commits the current session, if necessary.
- drupal_session_initialize in includes/
session.inc - Initializes the session handler, starting a session if needed.
- drupal_session_regenerate in includes/
session.inc - Called when an anonymous user becomes authenticated or vice-versa.
File
- includes/
session.inc, line 269 - User session handling functions.
Code
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;
session_start();
drupal_session_started(TRUE);
// Restore session data.
if (!empty($session_data)) {
$_SESSION += $session_data;
}
}
}