External cron (cron-job.org) blocked by JS cookie challenge – PHP never runs

Website URL

https://szamigabi.freehosting.dev/

Error Message

... document.cookie="__test="+toHex(slowAES.decrypt(...))+"; ... path=/"; location.href="https://.../cron_emlekezteto.php?key=...&i=1"; This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support

Other Information

I need to run scheduled PHP scripts (daily/weekly reminders, backup email, etc.).

URL called by cron-job.org:
https://szamigabi.freehosting.dev/csaladfa/cron_emlekezteto.php?key=SECRET
(same pattern for other cron_*.php scripts)
In a normal browser: the script runs correctly (plain text output, emails sent, lines written to logs/cron_runs.log).
Via cron-job.org: the response is only the InfinityFree anti-bot page above (AES/__test cookie + redirect). PHP is never executed. My log only shows my own browser IP, never the cron service IP.

Questions:

Is there a way to allow external HTTP cron so it is not blocked by the JS/__test check?
Does Cron Jobs in the client area run PHP via CLI and bypass this protection?
What is the recommended way to run scheduled PHP tasks on InfinityFree free hosting?

Thank you.

Welcome to the InfinityFree community forum! Good to have you here.

  • Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
  • Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
  • AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
  • Solving an issue is a joint effort. Try the suggestions you get and report back what happened.

Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.

No, there isn’t a way around it on free hosting, and there’s no built-in cron to use instead.

What you’re seeing is InfinityFree’s browser security system. It only lets a request through if the client can run JavaScript and keep cookies. cron-job.org can do neither, so it only ever gets the aes.js / __test page and your PHP never starts. That also explains why your log only shows your own browser. The article lists “automated scripts and bots” and webhooks from external services as things that won’t work, and says the system is mandatory and can’t be turned off:

On your questions:

  • Does Cron Jobs in the client area bypass this? No. That feature was disabled on 9 August 2023, and the announcement says automated background periodic requests are now prohibited on free hosting. It also says that attempts to reproduce the functionality will be blocked, so a workaround isn’t worth looking for.

    Cron Job Feature is now disabled

  • What’s the recommended way to run scheduled PHP tasks? On free hosting there isn’t one. The announcement points to premium hosting, which still has full cron job support, both web crons and PHP commands, with control over the schedule.

    iFastNet Premium Hosting - InfinityFree

If you stay on free hosting, the reminders and backup emails would have to be triggered some other way, for example by a visitor loading a page in a real browser. I haven’t found a source for any other approach.

What the bot says, basically.

Web cron tools and the like are explicitly blocked on our hosting because they distort activity metrics.

Please find another way to implement the functionality you need that doesn’t rely on scheduled tasks.