Hi,
Sorry on the late reply. I checked my php.ini to find out what my session.save_path is and it wasn't set (PHP\s default is nothing). So i set it to /var/lib/php/session based on the issue from Github and then chowned it to root:apache. This however doesn't seem to have been the issue as for some reason the validation still fails.
After searching through the forum earlier, I did notice that some people noted a wierd csrf behaviour with the absence of a favicon.ico. In my local server, my application picks up xampp\s favicon from the htdocs directory whereas my remote server doesn't have any favicon. Could this be the same case here?
I did try adding this to my project_root/.htaccess and my project_root/public/.htaccess:
RedirectMatch 204 /robots.txt
RedirectMatch 204 /favicon.ico
But it doesn't seem to have worked. DId I add this correctly? Or could it be caused by something else still?
Updated: It does seem to be a session issue no doubt. I tested by doing
var_dump($this->security->getSessionToken());
And it returned NULL. Doing session_save_path() returns me /var/lib/php/session as I've set it previously. I also checked if it is_writable and it returned me true.
Updated #2: I set the session.save_path to /tmp and now getSessionToken() is no longer NULL however the CSRF validation still fails.