ok, i have to calls to setcookie() in login.php
<?
if(!setcookie("3dartisan_username", "$username", time() + 15768000))
{
include('error.php');
error("Cookie could not be set!\nPlease contact info@3dartisan.net with this information");
}
if(!setcookie("3dartisan_password", "$password", time() + 15768000))
{
include('error.php');
error("Cookie could not be set!\nPlease contact info@3dartisan.net with this information");
}
?>
Login works fine, as when i return it says that i'm logged in.
but when i have the following in an included file it says i'm not logged in
<?
$cookie = $HTTP_COOKIE_VARS["3dartisan_username"];
if(!$cookie or $cookie == "")
{
?>
Not logged in.<br><a href="/login.php">Login</a> or <a href="/join.php">Register</a>
<?
}
else
{
?>
Logged in as<br>
<?
$username = $HTTP_COOKIE_VARS["3dartisan_username"];
echo $username;
}
i had checked the value of $cookie, and it was completely empty.
If needed, i can post the whole code from each script.
and the best part? when the cookie's included in an include as include('../member_options.php'); it works, but
include('http://www.3dartisan.net/member_options.php');
won't work.
in setcookie i was defining the domain as www.3dartisan.net and thought removing it would fix the prob, but it had no effect.