2011-05-08 29 views

回答

1

您不需要做任何特別的事情,因爲Cake的CookieComponent可以無縫地處理數組。

在你的控制,確保你已經包括了CookieComponent:

var $components = array('Cookie'); 

在你的行動,寫一個數組:

$this->Cookie->write('test', array('value1', 'value2')); 

然後讀回:

$test = $this->Cookie->read('test'); // $test will be an array 
+0

將cookie看起來像CookieName [0] =瀏覽器資源中的值? – Juan 2013-08-13 22:29:50

相關問題