It seems that the problem is cookie encryption. Laravel will delete the cookies that it can't decrypt. As test cookies is not created by laravel (I simply use an array to test cookies as seen in the previous post), they are not encrypted and they will be deleted. I can think of two solutions for this problem.
Simply remove cookie middleware from the list in app/Http/Kernel.php. All cookies will be sent to and received from the client as they are. If you don't need encryption or you want to read some cookies in the client side this is a nice solution.
Edit middleware so that it won't encrypt or decrypt cookies during testing. Just add a code to handle function that checks the environment and continues without doing anything if environment is testing. This middleware is in Illuminate/Cookie/Middleware/EncryptCookie.php. So a framework update will undo your editing in this file. If you need encrpytion this is your only solution.
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us