65 if ($this->started && !$this->closed) {
69 if (empty($this->
id)) {
73 $this->started =
true;
74 $this->closed =
false;
82 public function regenerate($destroy =
false, $lifetime = null) {
83 if (!$this->started) {
96 if (!$this->started || $this->closed) {
97 throw new RuntimeException(
"Trying to save a session that was not started yet or was already closed");
99 $this->closed =
false;
120 if ($this->started) {
121 throw new RuntimeException(
'Cannot change the ID of an active session');
150 return sha1(uniqid(mt_rand()));
157 if (!$this->started) {
160 return array_key_exists(
$name, $this->data);
167 if (!$this->started) {
177 if (!$this->started) {
187 if (!$this->started) {
197 if (!$this->started) {
200 $this->data = array();
210 if (!$this->started) {
214 if (array_key_exists(
$name, $this->data)) {
215 $retval = $this->data[
$name];
216 unset($this->data[
$name]);
226 if (!$this->started) {
229 $this->data = array();
has($name)
{Checks if an attribute is defined.The attribute nameboolean}
generateId()
Generates a session ID.
save()
{Force the session to be saved and closed.This method must invoke session_write_close() unless this i...
clear()
{Clears all attributes.void}
start()
{Starts the session.boolean True if started. If something goes wrong starting the session...
replace(array $attributes)
{Replaces all attributes.Attributes void}
regenerate($destroy=false, $lifetime=null)
{Regenerates id that represents this storage.This method must invoke session_regenerate_id($destroy) ...
getId()
{Returns the session ID.string The session ID or empty.}
isStarted()
{Checks if the session is started.boolean True if started, false otherwise.}
all()
{Returns all attributes.array Attributes}
setName($name)
{Sets the session name.Session name. void}
__construct($name= 'MOCKSESSID')
Constructor.
getName()
{Returns the session name.string The session name.}
setId($id)
{Sets the session ID.Session string void}