Is that what this is called? I wish I would've known that... Might've saved me some time with Google.
I'd like to shy away from solely CSS solutions if possible.
If messy means garbage collection, all I'd have to do is just set the cookie to null where appropriate. That's not that messy unless you're referring / implying / eluding to something else...?
Again, it's all about whatever works, I guess. But I did what I did with the cookie because it works, so I guess we're one in the same man.
Do you know is that block code is executed before the page is rendered?