summaryrefslogtreecommitdiff
path: root/app/Core/Session/FlashMessage.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Core/Session/FlashMessage.php')
-rw-r--r--app/Core/Session/FlashMessage.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/app/Core/Session/FlashMessage.php b/app/Core/Session/FlashMessage.php
index e02d056d..037717c2 100644
--- a/app/Core/Session/FlashMessage.php
+++ b/app/Core/Session/FlashMessage.php
@@ -7,7 +7,7 @@ use Kanboard\Core\Base;
/**
* Session Flash Message
*
- * @package session
+ * @package Kanboard\Core\Session
* @author Frederic Guillot
*/
class FlashMessage extends Base
@@ -43,11 +43,11 @@ class FlashMessage extends Base
*/
public function setMessage($key, $message)
{
- if (! isset($this->sessionStorage->flash)) {
- $this->sessionStorage->flash = array();
+ if (! session_exists('flash')) {
+ session_set('flash', []);
}
- $this->sessionStorage->flash[$key] = $message;
+ session_merge('flash', [$key => $message]);
}
/**
@@ -61,9 +61,14 @@ class FlashMessage extends Base
{
$message = '';
- if (isset($this->sessionStorage->flash[$key])) {
- $message = $this->sessionStorage->flash[$key];
- unset($this->sessionStorage->flash[$key]);
+ if (session_exists('flash')) {
+ $messages = session_get('flash');
+
+ if (isset($messages[$key])) {
+ $message = $messages[$key];
+ unset($messages[$key]);
+ session_set('flash', $messages);
+ }
}
return $message;