1
我想在Cookie中存儲的一些信息以這樣的方式Laravel 5餅乾:得到,則返回null EncryptCookies開啓
setcookie("o_favourites", serialize($fav_ids), time()+60*60*24*1825);
如果EncryptCookies中的app/Http/Kernel.php
$middleware
部分開啓(加入\App\Http\Middleware\EncryptCookies::class,
禮物)我試圖獲取cookie時收到null:
$cookie = Cookie::get('o_favourites');
什麼會導致此行爲?
BTW我用setcookies(),因爲Cookie::queue(Cookie::forever('o_favourites', serialize($fav_ids), null, null, false, false));
似乎不工作