protected function SessionProxy_Backend_Base::generateSessionIdentifier in Session Proxy 7
Generate new session identifier, set it as PHP session identifier and return it.
Return value
string
3 calls to SessionProxy_Backend_Base::generateSessionIdentifier()
- 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 42
Class
Code
protected function generateSessionIdentifier() {
$this->sessionIdentifier = drupal_hash_base64(uniqid(mt_rand(), TRUE));
// Depending on the underlaying implementation, some hash may fail to
// achieve the session_start() especially if you are using the PHP native
// one to handle session storage.
$this->sessionIdentifier = str_replace('_', '-', $this->sessionIdentifier);
session_id($this->sessionIdentifier);
return $this->sessionIdentifier;
}