What is the purpose of the “COOKIEHASH” constant?
-
Hey!
I’m developing a plugin that makes use of cookies and I looked at core WP code for guidelines on how to make cookies work nicely with WP (given that there can be multisite installations and such). I came across the
COOKIEHASH
constant which is used in names of a lot of cookies but I can’t guess the exact purpose of suffixing cookie names with it.One idea that I had was that this is used to work with multisite installations, but most of the cookies (if not all) also have the
setcookie()
“path” and “domain” parameters set, so this shouldn’t be an issue on multisite installations.The other idea was to make it a bit harder for attackers to guess the name of the cookie. While this would work for very basic attacks, since COOKIEHASH is a MD5 checksum of the site’s URL address, any attacks that would try to hack a site using cookies would take that into account.
So what exactly is the purpose of
COOKIEHASH
? Maybe it’s something else than the above?
- The topic ‘What is the purpose of the “COOKIEHASH” constant?’ is closed to new replies.