dimanche 31 juillet 2016

Laravel cookie sent to browser but not saving it

I am working with Laravel 5.2. When i working on my local envierment (vagrant) the code is working and the cookies are save at the browser. but when i trying it on production envierment, the cookie sent to the browser but it's not saving it. Can anyone help me please?

code:

    if (isset($cookies['poptin_display'])){
        //var_dump($cookies);
        return response()->json($poptinTrigger)->withCookie('poptin_dispaly_returning_visitor',$visit_counter, 86400)->withCookie('poptin_dispaly_after_x_visiting',$visit_first_time, 86400);
    }else{
        return response()->json($poptinTrigger)->withCookie('poptin_display',true, 1440)->withCookie('poptin_dispaly_returning_visitor',$visit_counter, 86400)->withCookie('poptin_dispaly_after_x_visiting',$visit_first_time, 86400);
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire