Following the docs I have created a cookie to last "forever" (5 years) on my local virtual host (indgo.dev).
so this:
$cookie = Cookie::forever('hash',$project['hash']);
dd($cookie);
outputs:
object(Symfony\Component\HttpFoundation\Cookie)#436 (7) {
["name":protected]=>
string(4) "hash"
["value":protected]=>
string(360) "eyJpdiI6IlNJcUJZSElRTlwvQ0dJU3Z4dE44VFwvYjJ3U3lpckRZY2xsV3NlWTJ5VHJ1dz0iLCJ2YWx1ZSI6IkFHeFJGOXhjSzZxTkhZWGpIMiszUWZ5eXBUT2xuMTZFalpXdVZ3VW1CYUh1SmxKZUNPMk1rSFhONFk4REVkMzBtWlluWVhWU21uVHJXMDllKytmYm5idk5IVTNcLzIrUEgyZ3dsVllVTERyeTROU1lKUHUwb1ZpRll2V1JmU0Z4bSIsIm1hYyI6Ijc1YzcyODlkOTU0MGQ3ZjEyMDJhNjk5ZWNhOWY2ZWNhMGRhNzU4NjZiOTAwNGUzMjY1MzI2YjhhNGZjMWVhMzgifQ=="
["domain":protected]=>
NULL
["expire":protected]=>
int(1523085636)
["path":protected]=>
string(1) "/"
["secure":protected]=>
bool(false)
["httpOnly":protected]=>
bool(true)
}
However, when I try to get the cookie on a differernt request:
$hash = Cookie::has('hash');
dd($hash);
I get false
(or null
if I use the get
method)
Using Chrome Dev tools I found that indeed the cookie doesn't show. The only ones listed are laravel_payload
and laravel_session
.
UPDATE: When I login a new remember_me
cookie is created by the Auth
class