I having the problem with cookies. The cookies will be only created when I refresh the page twice. During the first time the page is being executed, the result of creating a cookie is success but i can't get any value from the cookie i created. Then I manage to get the value when i refresh the page. Is there any problem regarding to the apache or php option. Besides, I never specify any directory for this cookie but the result is I can only get cookie from the directory it has been created. Is there any solution for this?
the code for creating cookies is as below:
setcookie("cookie_1", "test1");
setcookie("cookie_2", "test2");

