/** * Construct method. * * @param \Cake\Controller\Controller $controller The controller that was fired. */ public function __construct(Controller $controller) { $this->_controller = $controller; $this->_session = $controller->request->session(); $this->_cookie = $controller->Cookie; $this->_locales = Configure::read('I18n.locales'); $this->_locale = I18n::locale(); $this->_cookie->configKey('language', ['expires' => '+1 year', 'httpOnly' => true]); }