lundi 5 septembre 2016

Laravel 5.1 store cookie and share with other page issue

I am trying to save some data to the cookie and store it user's browser. So first, i created this code:

$view = view('config', compact('vehicleConfig');
    return response($view)->withCookie('fff', $cookie, 3);

But this is storing in response cookie, so i can't reach that from other pages such as home..

But instead of these codes, this code writes to the request code and i can reach it from everywhere:

$response->withCookie(cookie('retrox', 'valuex', 60));

return $response;

So, if i use "view" i can't reach to cookie data from other pages.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire