Solved! Go to Solution.
The cookie is stored at the domain level, not the subdomain level, so it would be accessible from pages on both www.marketo.com and pages2.marketo.com.
This is awesome stuff, and congrats on figuring out the code yourself!
I was able to get with some of our developers and build essentially the same thing on our end. The issue I'm working through with them now is that the cookies are sometimes read and interpreted correctly, while other times they are not. Haven't been able to recreate the issue consistently. Sometimes on the same browser in the same session the cookie will be read incorrectly and the value will be stored in the HTML translation of the original text.