funway
4 years ago
289
4
Laravel

Cookie setting doesn't work if i use dump() function

Posted 4 years ago by funway
Route::get('cookie', function () {
    $response = new Illuminate\Http\Response('Hello World');

    $response->withCookie('apple', '10', 10);

    var_dump(Request::cookie());

    /**
     * if i use the dump function in vendor/symfony/var-dumper/Resources/functions/dump.php
     * then setting cookie will not be working.
     * comments this line, setting cookie will work well.
     */
    dump(123);

    return $response;
});

Please sign in or create an account to participate in this conversation.