lithium\storage\session\adapter\Php::write()
Write a value to the session.
Parameters
-
string
$keyKey of the item to be stored.
-
mixed
$valueThe value to be stored.
-
array
$optionsOptions array. Not used for this adapter method.
Returns
\ClosureFunction returning boolean true on successful write, false otherwise.
Source
public function write($key, $value, array $options = array()) {
if (!$this->isStarted() && !$this->_start()) {
throw new RuntimeException('Could not start session.');
}
$self = $this;
return function($class, $params) use ($self) {
return $self->overwrite(
$_SESSION, Set::insert($_SESSION, $params['key'], $params['value'])
);
};
}