public static function save($message, $level = Message::LEVEL_ERROR) { $c = __CLASS__; $message = new $c($message, $level); Session::start(); $_SESSION['messages'][] = $message; return $message; }
protected function getTokenValue($name) { // Start session Session::start(); if (!empty($_SESSION[$name])) { return $_SESSION[$name]; } else { $token = $this->generateToken(); $_SESSION[$name] = $token; return $token; } }