Retrieving Input: Cookies
All cookies created by the Laravel framework are encrypted and signed with an authentication code, meaning they will be considered invalid if they have been changed by the client.
Retrieving Cookies From Requests
All cookies created by the Laravel framework are encrypted and signed with an authentication code, meaning they will be considered invalid if they have been changed by the client. To retrieve a cookie value from the request, use the cookie method on a Illuminate\Http\Request instance.
Alternatively, you may use the Cookie facade to access cookie values.
Attaching Cookies To Responses
Return response('Hello World')->cookie(
'name', 'value', $minutes, $path, $domain, $secure, $httpOnly
);
- You may attach a cookie to an outgoing Illuminate\Http\Response instance using the cookie method. .
- Alternatively, you can use the Cookie facade to "queue" cookies for attachment to the outgoing response from your application.
- You may use the cookie method to generate a cookie and fluently attach it to the response instance.
- Alternatively, you can use the Cookie facade to "queue" cookies for attachment to the outgoing response from your application.