laravel/framework — pull request #1688 by samsullivan (2013-06-19 23:05:21+00:00)
Title: Fix for issue #1281

I was looking for a way to set a cookie right away with Laravel (like PHP's `setcookie()`) and I came across issue #1281. I decided the easiest way to take care of this was to implement PHP's `setcookie()` rather than worrying about saving the cookie into some sort of CookieBag.

This commit extends `CookieJar::make()` by setting the cookie manually if headers have not already been set. Whether or not headers have been set, the `Cookie` will still be returned so it can be attached to the Response.