I only set cookies once, when they login. But you have to set the domain for the cookies.
And this is how it happens:
Old Domain: www.myoldsite.com
New Domain: www.mynewsite.com
OK, someone goes to www.mynewsite.com/login.php and enters a username. When they click 'Login', the script goes to 'client_access.php' and makes sure it's a valid login and sets the cookies. I then use a 'header("Location: welcome.php");' if everything is ok.
The problem is that because of the aliase/redirect, the user will login on 'www.mynewsite.com/login.php', yet along the line it goes to 'www.myoldsite.com/welcome'.
The welcome.php tests to make sure that the user has the correct cookie, and if not the user is redirected to 'login.php' with an error message, yet it won't have the correct cookie because it's a different domain then what's in the cookie.
So my main problem at the moment is the aliase/rederect. I'm not in contact with the web hosting company, the person in charge of this project is, but all I know is that they got a new domain, and now the old and new domains point to the same directory structure. I'm not sure what is causing it to switch between domains since I'm only using relative links in my script.
But that brings me back to the whole problem. Both domains point to the same IP, so is there a way to set a cookie to an IP address rather than a text domain?
Did I make sense?