For some reason, my page sometimes automatically redirects to index, it seems like its on pages that set cookies, and i'm sure that is the case but i'm not sure why it would only do it sometimes and not other times. Any ideas?
Look for header("location:index.php") I am not sure why it would only do it sometimes. Maybe it is in an if statement that you trigger sometimes. Post your url so we can check.