The site has 3 pages:
Home, Account, Cart, and a menu to navigate to them.
What I do is:
On the Home page I set the cookie on submit button click. (the page refers to itself)
I then navigate to another page (Account) and check if the cookie is set. And it is.
Then I navigate to next page (Cart) and check if the cookie is set. And it is.
The problem:
When I go back to the page where I originally set the cookie, it always dispalys that the cookie has not been set.
Expand|Select|Wrap|Line Numbers
- setcookie('myCookie', 'Val', 0, '/', false); //this is done on Home page
- //The following is done on all pages...
- if(isset($_COOKIE['myCookie']))
- {
- echo($_COOKIE['myCookie']);
- }
- else
- echo('not set');
Can anyone share some knowledge please?