class SessionProxy_Backend_Native in Session Proxy 7
Native implementation of session backend: use PHP native session handling. Using it allows to use built-in extensions session handling, such as Redis or Memcache extensions features, which are known to be really fast.
Hierarchy
- class \SessionProxy_Backend_Base implements SessionProxy_Backend_Interface
- class \SessionProxy_Backend_Native
Expanded class hierarchy of SessionProxy_Backend_Native
1 string reference to 'SessionProxy_Backend_Native'
- drupal_session_initialize in ./
session.inc - Initializes the session handler.
File
- lib/
SessionProxy/ Backend/ Native.php, line 8
View source
class SessionProxy_Backend_Native extends SessionProxy_Backend_Base {
protected function getSessionUid() {
return isset($_SESSION['uid']) ? $_SESSION['uid'] : NULL;
}
public function writeDisable() {
}
public function writeEnable() {
}
public function isWriteEnabled() {
return TRUE;
}
public function regenerate() {
global $user;
if (!$this
->sessionIsEmpty()) {
$currentData = $_SESSION;
}
if ($this->started) {
$this
->destroy();
}
$this
->generateSessionIdentifier();
if (isset($currentData) && !empty($currentData)) {
$_SESSION = $currentData;
$this
->start();
if ($user->uid) {
$_SESSION['uid'] = $user->uid;
}
}
else {
if ($user->uid) {
$this
->start();
$_SESSION['uid'] = $user->uid;
}
}
if ($this->started) {
// Some PHP versions won't reset correctly the cookie.
$params = session_get_cookie_params();
$expire = $params['lifetime'] ? REQUEST_TIME + $params['lifetime'] : 0;
setcookie($this->sessionName, $this->sessionIdentifier, $expire, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
}
$this
->refreshAfterSessionChange();
}
public function destroyAllForUser($uid) {
return;
}
}