66 if ($this->started && !$this->closed) {
70 if (empty($this->
id)) {
74 $this->started =
true;
75 $this->closed =
false;
83 public function regenerate($destroy =
false, $lifetime = null) {
84 if (!$this->started) {
97 if (!$this->started || $this->closed) {
98 throw new \RuntimeException(
"Trying to save a session that was not started yet or was already closed");
100 $this->closed =
false;
121 if ($this->started) {
122 throw new \RuntimeException(
'Cannot change the ID of an active session');
151 return sha1(uniqid(mt_rand()));
158 if (!$this->started) {
161 return array_key_exists(
$name, $this->data);
168 if (!$this->started) {
178 if (!$this->started) {
188 if (!$this->started) {
198 if (!$this->started) {
201 $this->data = array();
211 if (!$this->started) {
215 if (array_key_exists(
$name, $this->data)) {
216 $retval = $this->data[
$name];
217 unset($this->data[
$name]);
227 if (!$this->started) {
230 $this->data = array();
__construct($name= 'MOCKSESSID')
Constructor.
generateId()
Generates a session ID.
has($name)
{Checks if an attribute is defined.The attribute nameboolean}
setId($id)
{Sets the session ID.Session string void}
getName()
{Returns the session name.string The session name.}
save()
{Force the session to be saved and closed.This method must invoke session_write_close() unless this i...
clear()
{Clears all attributes.void}
regenerate($destroy=false, $lifetime=null)
{Regenerates id that represents this storage.This method must invoke session_regenerate_id($destroy) ...
replace(array $attributes)
{Replaces all attributes.Attributes void}
start()
{Starts the session.boolean True if started. }
isStarted()
{Checks if the session is started.boolean True if started, false otherwise.}
all()
{Returns all attributes.array Attributes}
getId()
{Returns the session ID.string The session ID or empty.}
setName($name)
{Sets the session name.Session name. void}