public function removeCookie()
 {
     $this->autoRender = FALSE;
     $data = $this->request->data;
     if ($this->request->is('post')) {
         $name = $data['name'];
         $result = parent::deleteCookie($name);
         Log::debug('cookie value of' . $name . 'deleted');
     }
     if (is_null($result)) {
         $result = 0;
     }
     $this->response->body($result);
     $this->response->type('text/html');
 }
 public function stockUpload()
 {
     $data = $this->request->data;
     if ($this->request->is('post') and isset($data['add-m'])) {
         parent::writeCookie('msu-message', 'Material Stock Updated');
         $this->redirect('inventory/stockupload');
     } elseif ($this->request->is('post') and isset($data['add-mb'])) {
         parent::writeCookie('mbsu-message', 'Material Brand Stock Updated');
         $this->redirect('inventory/stockupload');
     } elseif ($this->request->is('post') and isset($data['su'])) {
         $this->redirect('inventory/stockupload');
     }
     $message = parent::readCookie('msu-message');
     parent::deleteCookie('msu-message');
     $message1 = parent::readCookie('mbsu-message');
     parent::deleteCookie('mbsu-message');
     if ($message) {
         \Cake\Log\Log::debug('message:- ' . $message);
         $this->set(['message', $message]);
     } else {
         \Cake\Log\Log::debug('message:- ' . $message1);
         $this->set(['message', $message1]);
     }
 }