Laravel 5.1 create 5 minute cookie then return view
<p>I want to set 5 minutes cookie then return to view, </p>

<p>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.</p>

<p>But if i return response without view, it works perfectly.</p>

<pre><code>$response = new Illuminate\Http\Response();
return $response-&gt;withCookie(cookie('yes', 'value', 5));
</code></pre>

<p>This works perfectly.</p>

<p>But this is not:</p>

<pre><code>$response = new Illuminate\Http\Response(view('somepage'));
return $response-&gt;withCookie(cookie('yes', 'value', 5));
</code></pre>

<p>How can i create view after set up cookie?</p>