I'm developing a custom page to perform some nightly maintenance on the database.
When I browse to it using Chromium or Firefox, it does exactly what I expect it to. However, if I call it using 'wget' (V1.15) it is redirected (302) to the cookie_usage page.

Since this is my first attempt at building a custom page I have based the structure and boilerplate of my page on an existing module, sitemapxml. The functionality, however, is nothing at all to do with sitemapxml. My page is on the catalogue side, in /includes/modules/pages/my_update with a template in /includes/templates/template_default/my_update and a class to implement the functionality in /includes/classes.

Calling sitemapxml using wget works correctly. In fact, this is how it is usually called via a cron job. I want to do the same with my code but cannot get it to execute using wget. I have not disabled cookies in wget and the fact that it works with sitemapxml suggests that I have it configured correctly. I use:

wget 'http://www.xxxx.com/index.php?main_page=my_update&action=update&imagedir=genuine_images&all_images=1&max_records=10' -O my_update_test.html -o my_update_test.log
I have also tried setting wget's user-agent string to the same as Chromium uses but this seems to make no difference. I have removed all the business logic from my page and still get the redirect.

I understand that ZenCart must be trying to determine that the caller supports cookies and deciding that it doesn't. What could the difference be between two custom pages such that one is redirected to cookie_usage and the other is not, given that both pages are retrieved in the same way?

I've searched the forum and I've searched the ZenCart code to find the only places where the redirect is made are in code that requires a session (e.g. login or checkout). My code doesn't require a session and doesn't try to log in.