i want to use cookie
in web page and i want to use it for save any optional variables. but after use setcookie
and refresh page isset()
When you set a cookie, it is sent to the browser. The next time the browser then sends a request for a page, it sends the cookie information back and the page can make use of it.
To fix it, redirect the user to the page where you want to display the data after the cookie has been set, instead of simply displaying the page. This way you can make use of the cookie data.