this is just how the console works. They are not setting the cookies forever, once they refresh things are changed.
You can also do
console.error("Oh dear, we have an error");
And you'll have an error message. But it will again only be for the current user and only until they refresh.
You can even edit the HTML and CSS, again nothing permanent.
I understand this may be concerning, but I don't think the overall impact is usually that large. In essence, anything they can see they can already do.
If you are worried about something more specific such as them gaining access then you should consider how to make that process more secure so they cannot guess what to set the value as perhaps.