What could be causing a new cookie to be constantly created in Firefox when the code works fine in Google Chrome?

The issue could be related to how cookies are being handled in Firefox compared to Google Chrome. One possible solution is to explicitly set the cookie domain and path to ensure consistency across different browsers. This can help prevent the creation of a new cookie in Firefox.

setcookie('cookie_name', 'cookie_value', time() + 3600, '/', 'yourdomain.com');