In a Project i am using CakePHP 2.8.6. I am developing on my local environment (Macbook with Apache/2.4.23 (Unix) and PHP/5.6.16, MariaDB in a vagrant virtual machine) using git to deploy to the production server. The Project is set up to use the database for storing Sessions. When using
$this->Flash->danger('Error_msg');
return $this->redirect(array('action' => 'view/'.$id));
the Cookie and database entries are getting stored and the database contains the Error_msg. However, after redirecting to view/id the message is not shown to the user and remains stored in the database.
When i remove the return statement the Message is shown and the database entry is cleared. But it is not the desired way.
Now the funny part: When i deploy to the production server, everything works fine. The production server is running nginx 1.6.2 with php-fpm 5.6.24 and MariaDB 10.0.26. Even after the redirect the message is shown. Just to make clear: for development i am using Debug = 2, on the production machine Debug = 0.
I cannot figure out why this is not working on my local development environment. I installed a vagrant virtual machine just a few minutes ago, containing nginx 1.6.2 and php-fpm 5.6.24 and MariaDB 10.0.26 and even there it is not working. The production server is the only environment where the message gets shown correctly after the redirect. I compared the config files on the prod-server and the vagrant-machine but can't find major differences besides the hostname etc.
Anyone who can help figure this out? I can't test and develop anything using Sessions without this part working as expected...
edit: on the virtual machine i did set debug to 0 but no messages are shown. Even if i set debug to 0 on the dev env it is not working.
edit 2: In the AppController i have the following configuration:
public $helpers = array('Html', 'Form', 'Flash');
public $components = array('RequestHandler', 'Cookie', 'Session', 'Flash');