After exploring this more, and trying out a different browser (IE, instead of Firefox), I noticed that the bug did not occur!

On closer examination, the problem was that the cookie I was setting was for the domain 'www.deepnettech.com', and Zencart often uses default path 'http:deepnettech.com/estore...'. These are different cookie settings.

So, I changed where I set the cookies up in the first place, to set the domain as '.deepnettech.com', so that they work generically!

So, init_sanitize.php was a red herring! Sorry folks.