Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/components/session/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,20 @@ public function getSid() {
* Read Session information for the given index
*
* @param string $name The name of the index to read
* @param boolean $persist If set data will persist, otherwise will be cleared after read
* @return mixed The value stored in $name of the session, or an empty string.
*/
public function read($name) {
if (isset($_SESSION[$name]))
return $_SESSION[$name];
public function read($name, $persist=true) {
if (isset($_SESSION[$name])){
$val = $_SESSION[$name];

if($persist == false){
$this->clear($name);
}

return $val;
}

return "";
}

Expand Down Expand Up @@ -276,4 +285,4 @@ private function sessionGarbageCollect($lifetime) {
return $this->Record->affectedRows();
}
}
?>
?>