Do not alter cookie contents Do not alter the contents of a cookie that the user has already accepted. This requires the user to re-accept the cookie. Set a cookie only once Some CGI programs on the Web make the mistake of setting the same cookie multiple times, even after the user has already accepted it. This completely unnecessary practice punishes rather than rewards the visitor who has previously accepted a cookie from the site. A Web site should only offer a cookie in conjunction with forms.
Some sites offer a cookie when the visitor first views a form.
However, it is preferable to offer a cookie only when the user submits a form. This approach reinforces the connection in the visitor's mind between the data submitted and the receipt of the cookie. Avoid offering a cookie on the home page The home page of a site, unless it contains a form, should never set a cookie. Offering a cookie while the home page loads creates an unpleasant initial impression for first-time visitors who use cookie notification. By not offering a cookie, the home page has the opportunity instead to offer a link to a statement about how the site uses cookies.