For this simple cookie I am calling "site_cookie_1" I want to track returning customers. The cookie also has a built in expiry of one day upon which it will in essence self destruct.
Next I wrote in PHP to reflect to the screen whether the user has a cookie or not. Once the cookie is set there is a visual confirmation with the cookie name echoed back to the user. This can also be sent to a text file for logging purposes.
So now when I first visit the cookies.php page I am greeted with a warning that I have not yet had any cookies set on my account.
Now I reload the page and the cookie script runs. Now a cookie is set and the value is reflected to the screen.
And here reviewing the application details I can see that I indeed have a site cookie named site_cookie_1 with the value of return+customer coming from the server which in this case is localhost and it has an expiry date of one day from now.
Return customer cookie is set. |
No comments:
Post a Comment