I've got a couple of PHP scripts which I call functions from using XMLHttpRequest in JS from my front end.
If I hit the PHP scripts directly in the browser, the session (session_start();$_SESSION["working"] = "true";) and session variables are retained, but if I call them from the webpage using XMLHttpRequest they are not.
Is this expected behaviour, as PHP has no way of knowing the session is still active when calling it with XMLHttpRequest?
I was hoping (not expecting), that PHP would somehow know the session was still active.
Works fine if I access the PHP files directly in the browser, even if I switch between different files, but not when called from JS.