Nowadays many websites used internet cookies which is in fact a piece of code or a script that can store user data and other preferences, it usually cannot be executed by itself think of it like your personal secretary who manages all your daily routine, meetings, agenda, reports etc. Since everything are connected to the internet, could internet cookies turns into A.I. smart enough to silently track and gain access to a nuclear silo or tactical sub and fires a nuclear warhead at random?
I think you misunderstand cookies, or how powerful they are.
Cookies are not executed. They hold text-data, and that text-data is read.
Taken from Wikipedia:
A cookie consists of the following components:
Name Value Zero or more attributes (name/value pairs). Attributes store information such as the cookie’s expiration, domain, and flags (such as Secure and HttpOnly).
So, no code that can turn into an AI, at least not with current technology and cookies.
As pointed out in comments, cookies are not executable code. Therefore, they are not executed. Discussion on Information Security.SE here. The big takeaway is that a bug that allowed execution of cookies as code would be a very big deal in computer security terms. It is almost certain that such a bug does not exists in any of the major browsers.
There are ways around all these things, but at that point you are talking about a plain ol' computer virus, or worm, or SkyNet or something. So the answer is, there is no real way to make a distributed AI work the way you are describing.