How To Send Cookies To A Website Through Laravel Panel Using PHP?

70 Views Asked by At

I have built a website abcd.com where I want to sell online products. It is connected with amember pro.

Now I have created a panel in Laravel, panel.abcd.com where I set up the products url and cookies.

Now if I update or put cookies on panel.abcd.comI want that cookies to redirect on abcd.com site so that user do not need to log in to use my product. I want to redirect that cookies to my abcd.com/product.

I am able to redirect the site. But the cookies is not redirecting.

<?php `
$con=mysqli_connect('localhost','newuser','password','mark12');
if(isset($_GET['tool'])){
 echo $tool=mysqli_real_escape_string($con,$_GET['tool']);
$res=mysqli_query($con,"select domain from extension_tools where tool_name='$tool'");
 $count=mysqli_num_rows($res);
if($count>0){
$row=mysqli_fetch_assoc($res);
 $domain=$row['domain'];
header('location:'.$domain);
die();
}

}


?>

That is the code I used to redirect to the product site in my amember setup.

and It's working but the cookies is not redirecting in that product site. Please help me to redirect the cookies also. Thank you.

0

There are 0 best solutions below