mirror of
https://github.com/getgrav/grav.git
synced 2026-07-06 04:17:33 +02:00
Added flash storage
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
1. [](#improved)
|
||||
* Updated jQuery from 2.2.0 to 2.2.3
|
||||
* Set `Uri::ip()` to static by default so it can be used in form fields
|
||||
* Improved `Session` class with flash storage
|
||||
1. [](#bugfix)
|
||||
* Fixed "Invalid slug set in YAML frontmatter" when setting `Page::slug()` with empty string [#580](https://github.com/getgrav/grav-plugin-admin/issues/580)
|
||||
* Only `.gitignore` Grav's vendor folder
|
||||
|
||||
@@ -65,4 +65,20 @@ class Session extends BaseSession
|
||||
setcookie(session_name(), session_id(), time() + $session_timeout, $session_path, $domain, $secure, $httponly);
|
||||
}
|
||||
}
|
||||
|
||||
// Store something in session temporarily
|
||||
public function setFlashObject($name, $object)
|
||||
{
|
||||
$this->$name = serialize($object);
|
||||
}
|
||||
|
||||
// Return object and remove it from session
|
||||
public function getFlashObject($name)
|
||||
{
|
||||
$object = unserialize($this->$name);
|
||||
|
||||
$this->$name = null;
|
||||
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user