So I've done quite a bit of digging and can only seem to come up with information on SlimFramework 2, nothing so much on 3.
My issue is this:
return $res->withStatus(401)->withHeader('Content-type','application/json')->write(json_encode(array(
'Error'=>'Your session has timed out.',
'X-SessionToken' => $session_uuid,
'Server date/time' => date('c'),
'Last activity' => Session::sharedInstance()->last_activity(),
'Path' => $path
)));
still returns back a status of 200, with the Content-type still set to text/html, but all of my body is there. Any thoughts? I tried looking through PSR-7 documentation on the write() to see if perhaps after that it sets the headers and status back to default, but didn't see anything.