Cookie を設定し、ヘッダー リダイレクトを使用しようとしています。ただしクッキーは設定しておりません。私は試しprint_r($_COOKIE)
ました。それで、私はクッキーがその場所に設定されていないと確信していますか?
setcookie("re",$re);
header('Location: ' . $_SERVER['HTTP_REFERER']);
すべてのドメイン内で使用できるようにするには、注文したパスを設定する必要があります...
資料通り
The path on the server in which the cookie will be available on.
If set to '/', the cookie will be available within the entire domain.
If set to '/foo/', the cookie will only be available within the /foo/
directory and all sub-directories such as /foo/bar/ of domain.
The default value is the current directory that the cookie is being set in.
これを試して
<?php
setcookie("re",$re,0,'/');
header('Location: ' . $_SERVER['HTTP_REFERER']);
?>
注:リファラーはあなたのドメインからのものでなければなりません