Yesterday I had my project that needs cookies in order to work on a subdomain and so naturally it was in the / directory. Today I moved it to a main domain and put it in a subfolder, being /site/. Anyways my main script is now working but my admin cp script which yesterday was /admin and now is /site/admin is not setting a cookie correctly. Any ideas on how I might be able to fix this?
include("../inc/setup.inc.php");
include("../inc/datainfo.inc.php");
$checkagain = @mysql_fetch_array(@mysql_query("select * from evoBoard_users where users_username = '$_GET[u]' and users_password = '$_GET[p]'"));
setcookie("adminboard",$checkagain[users_username],time()+12000,"/","$_MAIN[baseurl]");
// echo "<meta http-equiv='refresh' content='0; url=index.php?'>";
echo "$_COOKIE[adminboard]";
Like I said it worked perfectly fine on the subdomain but when I switch it into a folder and try using this cookie function, it doesn't work. I know both included files are connecting correctly. The SQL query is working correctly and I even took away the forwarding message and added an echo statement to show the cookie but the cookie never physically displays. Any idea on how I can fix?