mercredi 7 septembre 2016

Laravel 5.1 create 5 minute cookie then return view

I want to set 5 minutes cookie then return to view,

But if i use view in Response, cookie loses. And when i back to index page, i can't see that cookie. Because it lost.

But if i return response without view, it works perfectly.

$response = new Illuminate\Http\Response();
return $response->withCookie(cookie('yes', 'value', 5));

This works perfectly.

But this is not:

$response = new Illuminate\Http\Response(view('somepage'));
return $response->withCookie(cookie('yes', 'value', 5));

How can i create view after set up cookie?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire