From bd89ef533b000b12d439c122b1dc33f430af5ce3 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 11 Aug 2010 00:01:24 -0400 Subject: [PATCH] Updating session helper constructor to fix failing tests in Controller::render() integration tests. --- cake/libs/view/helpers/session.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cake/libs/view/helpers/session.php b/cake/libs/view/helpers/session.php index 08bbe9b5076..2ad5bd03722 100644 --- a/cake/libs/view/helpers/session.php +++ b/cake/libs/view/helpers/session.php @@ -31,6 +31,19 @@ */ class SessionHelper extends AppHelper { +/** + * Constructor. Starts the session if it has not already been started + * + * @param View $view View instance for this helper + * @param array $settings Settings for the helper. + * @return void + */ + public function __construct(View $view, $settings = array()) { + parent::__construct($view, $settings); + if (!CakeSession::started()) { + CakeSession::start(); + } + } /** * Used to read a session values set in a controller for a key or return values for all keys. *