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
13 changes: 10 additions & 3 deletions src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ abstract class Presenter extends Control implements Application\IPresenter
FLASH_KEY = '_fid',
DEFAULT_ACTION = 'default';

const FLASH_SESSION_NAMESPACE = 'Nette.Application.Flash';

/** @var int */
public $invalidLinkMode;

Expand Down Expand Up @@ -1285,7 +1287,7 @@ public function popGlobalParameters($id)
public function hasFlashSession()
{
return !empty($this->params[self::FLASH_KEY])
&& $this->getSession()->hasSection('Nette.Application.Flash/' . $this->params[self::FLASH_KEY]);
&& $this->getFlashSession()->hasSection(self::FLASH_SESSION_NAMESPACE);
}


Expand All @@ -1296,9 +1298,14 @@ public function hasFlashSession()
public function getFlashSession()
{
if (empty($this->params[self::FLASH_KEY])) {
$this->params[self::FLASH_KEY] = Nette\Utils\Random::generate(4);
$this->params[self::FLASH_KEY] = Http\FlashSession::generateId();
}

if ($this->flashSession === NULL) {
$this->flashSession = new Http\FlashSession($this->params[self::FLASH_KEY], $this->session);
}
return $this->getSession('Nette.Application.Flash/' . $this->params[self::FLASH_KEY]);

return $this->getSession(self::FLASH_SESSION_NAMESPACE);
}


Expand Down