Attaching Cookies To Responses
The withCookie helper method on the response instance allows you to easily attach cookies to the response. For example, you may use the withCookie method to generate a cookie and attach it to the response instance:
he withCookie method accepts additional optional arguments which allow you to further customize your cookie's properties