Search code examples
phplaravelcookiesnginxlaravel-forge

Laravel cookies with redirect


I've got Laravel cookies working on my localhost but not on Laravel Forge. On Forge, I get a Nginx 502 bad gateway error that I can't analyze because Forge doesn't give access to error logs. Might someone help?

Here's my code:

 \Cookie::queue('linkedin_user', $li_user); //commenting out this line allows for the proper redirect on Forge
 return redirect('/signup'); 

Solution

  • I couldn't get cookies to work so I ended up using Session instead. An easy swap with no hassles.

    \Session::put('linkedin_user', $li_user);
    return redirect('/signup');