Quantcast
Channel: Cookie not getting set in laravel - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by mishka for Cookie not getting set in laravel

$
0
0

SOLVED

Here is the new controller method and it works like a charm. Earlier the cookie was not attached to response.

public function order(Request $request, $currency = null){    $currency = store_currency($currency);    $plans = ServicePlan::popuplarPlansForHome('UNL', 5)->get();    $selectedPlan = $request->plan_id ? : '';    $right_now = Carbon::now();    return response()->view('checkout/order', compact('plans', 'selectedPlan', 'right_now'))        ->withCookie(Cookie::forever('store_currency', $currency));}

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>