I am setting cookie in in blade file using javascript by below piece of code
function showPosition(position) {
var lat=position.coords.latitude;
var lng=position.coords.longitude;
document.cookie="lat=" + lat;
document.cookie="lng=" + lng;
//var allcookies = document.cookie;
//alert(allcookies);
localStorage.setItem('latLng',latLng);
}
and in model i try to get cookie
$lat = Cookie::get('lat');
$lng = Cookie::get('lng');
dd($lat);
but it shows me null. Any help please.